Subject: RE: [RFC] r8152: pass through needs to be singular

From: Hayes Wang <[email-masked]>
Date: Mon, 8 Aug 2022 07:04:20 +0000

Oliver Neukum <[email-masked]>
> Sent: Thursday, August 4, 2022 4:58 PM
[...]
> >> +	if (!holder_of_pass_through) {
> >> +		ret = -EBUSY;
> >> +		goto failout;
> >> +	}
> >
> > Excuse me. I have one question.
> > When is the holder_of_pass_through set?
> > The default value of holder_of_pass_through is NULL, so
> > it seems the holder_of_pass_through would never be set.
> 
> 
> Hi,
> 
> here in vendor_mac_passthru_addr_read()

I mean that holder_of_pass_through is NULL, so you set ret = -EBUSY and goto failout.
However, holder_of_pass_through is set only if ret == 0. That is,
holder_of_pass_through = tp would never occur, because ret is equal -EBUSY.
The default value of holder_of_pass_through is NULL, so it has no chance to be set.
Right?

Best Regards,
Hayes

> >>  amacout:
> >>  	kfree(obj);
> >> +failout:
> >> +	if (!ret)
> >> +		holder_of_pass_through = tp;
> >> +	mutex_unlock(&pass_through_lock);
> >>  	return ret;
> >>  }