Re: [PATCH V3] scsi: lpfc: Fix a possible null pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Huai-Yuan,

Sorry for noticing this later, but a return len while len is 0 would
result in a silent $(cat /sys/class/scsi_host/host*/lpfc_xcvr_data).

Perhaps, it's better to log something to at least notify the user why
SFP information was not able to be collected.

How about something like this?

        /* Get transceiver information */
        rdp_context = kmalloc(sizeof(*rdp_context), GFP_KERNEL);
+       if (!rdp_context) {
+               len = scnprintf(buf, PAGE_SIZE - len,
+                                       "SFP info NA: alloc failure\n");
+               return len;
+       }

        rc = lpfc_get_sfp_info_wait(phba, rdp_context);
        if (rc) {


Thanks,
Justin Tee




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux