diff options
Diffstat (limited to 'drivers/scsi/esas2r')
-rw-r--r-- | drivers/scsi/esas2r/esas2r_flash.c | 7 | ||||
-rw-r--r-- | drivers/scsi/esas2r/esas2r_init.c | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c index 8582929b1fef..45e353f9616b 100644 --- a/drivers/scsi/esas2r/esas2r_flash.c +++ b/drivers/scsi/esas2r/esas2r_flash.c | |||
@@ -860,8 +860,13 @@ bool esas2r_process_fs_ioctl(struct esas2r_adapter *a, | |||
860 | return false; | 860 | return false; |
861 | } | 861 | } |
862 | 862 | ||
863 | if (fsc->command >= cmdcnt) { | ||
864 | fs->status = ATTO_STS_INV_FUNC; | ||
865 | return false; | ||
866 | } | ||
867 | |||
863 | func = cmd_to_fls_func[fsc->command]; | 868 | func = cmd_to_fls_func[fsc->command]; |
864 | if (fsc->command >= cmdcnt || func == 0xFF) { | 869 | if (func == 0xFF) { |
865 | fs->status = ATTO_STS_INV_FUNC; | 870 | fs->status = ATTO_STS_INV_FUNC; |
866 | return false; | 871 | return false; |
867 | } | 872 | } |
diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index 78b18c1eb435..9aaad0d1dcf6 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c | |||
@@ -665,7 +665,7 @@ void esas2r_kill_adapter(int i) | |||
665 | 665 | ||
666 | int esas2r_cleanup(struct Scsi_Host *host) | 666 | int esas2r_cleanup(struct Scsi_Host *host) |
667 | { | 667 | { |
668 | struct esas2r_adapter *a = (struct esas2r_adapter *)host->hostdata; | 668 | struct esas2r_adapter *a; |
669 | int index; | 669 | int index; |
670 | 670 | ||
671 | if (host == NULL) { | 671 | if (host == NULL) { |
@@ -678,6 +678,7 @@ int esas2r_cleanup(struct Scsi_Host *host) | |||
678 | } | 678 | } |
679 | 679 | ||
680 | esas2r_debug("esas2r_cleanup called for host %p", host); | 680 | esas2r_debug("esas2r_cleanup called for host %p", host); |
681 | a = (struct esas2r_adapter *)host->hostdata; | ||
681 | index = a->index; | 682 | index = a->index; |
682 | esas2r_kill_adapter(index); | 683 | esas2r_kill_adapter(index); |
683 | return index; | 684 | return index; |