summaryrefslogtreecommitdiff
path: root/drivers/scsi/osd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/osd')
-rw-r--r--drivers/scsi/osd/osd_initiator.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 0bbbf271fbb0..552f58b655d1 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -131,7 +131,7 @@ static int _osd_print_system_info(struct osd_dev *od, void *caps)
pFirst = get_attrs[a++].val_ptr;
OSD_INFO("OSD_ATTR_RI_PRODUCT_REVISION_LEVEL [%u]\n",
- get_unaligned_be32(pFirst));
+ pFirst ? get_unaligned_be32(pFirst) : ~0U);
pFirst = get_attrs[a++].val_ptr;
OSD_INFO("OSD_ATTR_RI_PRODUCT_SERIAL_NUMBER [%s]\n",
@@ -143,15 +143,18 @@ static int _osd_print_system_info(struct osd_dev *od, void *caps)
pFirst = get_attrs[a++].val_ptr;
OSD_INFO("OSD_ATTR_RI_TOTAL_CAPACITY [0x%llx]\n",
- _LLU(get_unaligned_be64(pFirst)));
+ pFirst ? _LLU(get_unaligned_be64(pFirst)) : ~0ULL);
pFirst = get_attrs[a++].val_ptr;
OSD_INFO("OSD_ATTR_RI_USED_CAPACITY [0x%llx]\n",
- _LLU(get_unaligned_be64(pFirst)));
+ pFirst ? _LLU(get_unaligned_be64(pFirst)) : ~0ULL);
pFirst = get_attrs[a++].val_ptr;
OSD_INFO("OSD_ATTR_RI_NUMBER_OF_PARTITIONS [%llu]\n",
- _LLU(get_unaligned_be64(pFirst)));
+ pFirst ? _LLU(get_unaligned_be64(pFirst)) : ~0ULL);
+
+ if (a >= nelem)
+ goto out;
/* FIXME: Where are the time utilities */
pFirst = get_attrs[a++].val_ptr;