]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/ata/sata_sx4.c
sata_sx4: correctly handling failed allocation
[linux-beck.git] / drivers / ata / sata_sx4.c
index fab504fd9cfd7ace54d772927a01650373d02206..48301cb3a3165a189981764b6fea81a87cbdb858 100644 (file)
@@ -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);