MLK-20240-7 fastboot: Add NULL return check
Fix coverity issue CID 1898965: Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be NULL dev_desc when calling write_backup_gpt_partitions Signed-off-by: Ye Li <ye.li@nxp.com>
This commit is contained in:
parent
7bc5136e52
commit
661bc6ec62
|
|
@ -880,6 +880,11 @@ int write_backup_gpt(void)
|
|||
return -1;
|
||||
}
|
||||
dev_desc = blk_get_dev("mmc", mmc_no);
|
||||
if (dev_desc == NULL) {
|
||||
printf("Can't get Block device MMC %d\n",
|
||||
mmc_no);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* write backup get partition */
|
||||
if (write_backup_gpt_partitions(dev_desc, interface.transfer_buffer)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue