mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-24 20:54:24 +08:00
cmd: sata: add null pointer check for dev
Calling sata_scan() with a null pointer probably won't make much sense. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
f388564965
commit
b3860bfe77
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user