]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hpsa: correct check for non-disk devices
authorDon Brace <don.brace@pmcs.com>
Fri, 6 May 2016 19:06:37 +0000 (12:06 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 22 May 2016 21:49:24 +0000 (14:49 -0700)
commite4c5639dc0abef35365aa391ffec3a9ff868b23a
treee9df84bb1e37caf53583e00f1f80ae0dbbd2e01d
parentcb0fd965e64474e821bd14e68b277dafa71a5fc0
hpsa: correct check for non-disk devices

The driver is using two MACROs which seemingly are looking in
the wrong location for the device_flags returned from
CISS_REPORT_PHYS. Both MACROs, NON_DISK_PHYS_DEV and
PHYS_IOACCEL, are using the pointer returned from figure_lunaddrbytes
which is the address of the LUN.lunid element in
the extended CISS_REPORT_PHYS.  But the MACROS are using offsets
beyond the range of the element (offset 17 of an 8 byte element).

These MACROs actually are looking at the correct location but
they fail static checker analysis. It also will not work
if any new elements are added to the extended LUN structure.

Change the code to use the structure elements directly
since this MACRO is only used in one location.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
drivers/scsi/hpsa.c
drivers/scsi/hpsa_cmd.h