Wrong usage of kstrtoul() parameter in cxlflash

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

 



The following code is used in drivers/scsi/cxlflash/main.c

		memcpy(tmp_buf, &vpd_data[i], WWPN_LEN);
		rc = kstrtoul(tmp_buf, WWPN_LEN, (ulong *)&wwpn[k]);

This seems to be a misinterpretation of kstrtoul parameters.
The second one is not a buffer length but the base for the conversion.
It may work just by chance because WWPN_LEN is 16, and the VPD string
may be a hex number. But definitely WWPN_LEN shouldn't be used here.



[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