Re: [PATCH][RESEND] scsi_sysfs: add 'is_bin_visible' callback

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

 



On Wed, Mar 02, 2016 at 03:33:14PM +0800, Hannes Reinecke wrote:
> >> +	rcu_read_lock();
> >> +	if (attr == &dev_attr_vpd_pg80 &&
> >> +	    !rcu_dereference(sdev->vpd_pg80)) {
> >> +		rcu_read_unlock();
> >> +		return 0;
> >> +	}
> >> +	if (attr == &dev_attr_vpd_pg83 &&
> >> +	    !rcu_dereference(sdev->vpd_pg83)) {
> >> +		rcu_read_unlock();
> >> +		return 0;
> >> +	}
> >> +	rcu_read_unlock();
> > 
> > We are only checking the pointers for being non-zero.  No need for the
> > rcu_read_lock() or rcu_dereference() here.
> > 
> Better to be same than sorry; some overly clever code analysis tool
> might trip over it otherwise.

It shouldn't.  There is no dereference going on here.

> 
> > Otherwise this looks fine to me.
> 
> Reviewed-by: ?

Only without the cargo culted rcu magic.
--
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