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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html