fsl-layerscape: fix compile error with sec fw disabled
[oweals/u-boot.git] / cmd / sata.c
index 6d62ba8f74aaceb9702d9db361e68966b89b304a..a73cc54bd3e97b7ad535a52fc153697e74e37e69 100644 (file)
@@ -60,6 +60,10 @@ int sata_probe(int devnum)
                printf("Cannot probe SATA device %d (err=%d)\n", devnum, rc);
                return CMD_RET_FAILURE;
        }
+       if (!dev) {
+               printf("No SATA device found!\n");
+               return CMD_RET_FAILURE;
+       }
        rc = sata_scan(dev);
        if (rc) {
                printf("Cannot scan SATA device %d (err=%d)\n", devnum, rc);