Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 427cc61a authored by Insu Yun's avatar Insu Yun Committed by Tejun Heo
Browse files

sata_sx4: correctly handling failed allocation



Since kzalloc can be failed in memory pressure, return error when failed.

Signed-off-by: default avatarInsu Yun <wuninsu@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 1980eb9b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1396,6 +1396,8 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
		addr = 0;
		length = size * 1024 * 1024;
		buf = kzalloc(ECC_ERASE_BUF_SZ, GFP_KERNEL);
		if (!buf)
			return 1;
		while (addr < length) {
			pdc20621_put_to_dimm(host, buf, addr,
					     ECC_ERASE_BUF_SZ);