libsrp, srp_target_alloc() and srp_target_free()

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

 



Hello,

There is an asymmetry between the libsrp functions srp_target_alloc()
and srp_target_free(): the former sets the pointer to driver-private
data by invoking dev_set_drvdata() while the latter does not clear
this pointer. So once srp_target_free() finished invoking
dev_get_drvdata() will return a dangling pointer. Would it be a good
idea to add the following statement inside srp_target_free() just
before this function returns ?

dev_set_drvdata(target->dev, NULL);

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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