aboutsummaryrefslogtreecommitdiff
path: root/cmd/scsi.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-06-17 06:36:00 -0700
committerSimon Glass <sjg@chromium.org>2017-07-28 12:02:47 -0600
commitdb13a768a07b31b4955db934f3d55d2c77335bcc (patch)
tree32cd979ba4351e0a2b02f5735512d4fd2a484183 /cmd/scsi.c
parent9c1390d4b988b1c7170dca9d06539ea1a363dfe7 (diff)
downloadu-boot-db13a768a07b31b4955db934f3d55d2c77335bcc.zip
u-boot-db13a768a07b31b4955db934f3d55d2c77335bcc.tar.gz
u-boot-db13a768a07b31b4955db934f3d55d2c77335bcc.tar.bz2
cmd: scsi: Fix null pointer dereference in 'scsi reset'
During 'scsi reset', scsi_bus_reset() is called with udevice pointed to NULL, which causes exception. As a temporary fix, disable the call for DM SCSI for now. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/scsi.c')
-rw-r--r--cmd/scsi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/scsi.c b/cmd/scsi.c
index 5709718..8e36de1 100644
--- a/cmd/scsi.c
+++ b/cmd/scsi.c
@@ -36,7 +36,9 @@ static int do_scsi(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
case 2:
if (strncmp(argv[1], "res", 3) == 0) {
printf("\nReset SCSI\n");
+#ifndef CONFIG_DM_SCSI
scsi_bus_reset(NULL);
+#endif
ret = scsi_scan(true);
if (ret)
return CMD_RET_FAILURE;