Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sata_sx4: correctly handling failed allocation

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

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Insu Yun and committed by
Tejun Heo
427cc61a 1980eb9b

+2
+2
drivers/ata/sata_sx4.c
··· 1396 1396 addr = 0; 1397 1397 length = size * 1024 * 1024; 1398 1398 buf = kzalloc(ECC_ERASE_BUF_SZ, GFP_KERNEL); 1399 + if (!buf) 1400 + return 1; 1399 1401 while (addr < length) { 1400 1402 pdc20621_put_to_dimm(host, buf, addr, 1401 1403 ECC_ERASE_BUF_SZ);