public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: max3421: unlock on error in max3421_hub_control()
@ 2017-10-27  6:26 Dan Carpenter
  2017-10-27  9:06 ` Jules Maselbas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dan Carpenter @ 2017-10-27  6:26 UTC (permalink / raw)
  To: kernel-janitors

We can't return directly in max3421_hub_control(), we have to unlock
first.

Fixes: 721fdc83b31b ("usb: max3421: Add devicetree support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 928a5aabee02..46a86a7f3360 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1704,7 +1704,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
 	pdata = spi->dev.platform_data;
 	if (!pdata) {
 		dev_err(&spi->dev, "Device platform data is missing\n");
-		return -EFAULT;
+		retval = -EFAULT;
+		goto unlock;
 	}
 
 	switch (type_req) {
@@ -1787,6 +1788,7 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
 		retval = -EPIPE;
 	}
 
+unlock:
 	spin_unlock_irqrestore(&max3421_hcd->lock, flags);
 	return retval;
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: max3421: unlock on error in max3421_hub_control()
  2017-10-27  6:26 [PATCH] usb: max3421: unlock on error in max3421_hub_control() Dan Carpenter
@ 2017-10-27  9:06 ` Jules Maselbas
  2017-10-27  9:36 ` Dan Carpenter
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jules Maselbas @ 2017-10-27  9:06 UTC (permalink / raw)
  To: kernel-janitors

Hi,

> We can't return directly in max3421_hub_control(), we have to unlock
> first.
Yes you are right.
I think testing if pdata is null is not necessary as driver_probe will fail if
the device do not have a platform_data.

Jules.

> Fixes: 721fdc83b31b ("usb: max3421: Add devicetree support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
> index 928a5aabee02..46a86a7f3360 100644
> --- a/drivers/usb/host/max3421-hcd.c
> +++ b/drivers/usb/host/max3421-hcd.c
> @@ -1704,7 +1704,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16
> value, u16 index,
> 	pdata = spi->dev.platform_data;
> 	if (!pdata) {
> 		dev_err(&spi->dev, "Device platform data is missing\n");
> -		return -EFAULT;
> +		retval = -EFAULT;
> +		goto unlock;
> 	}
> 
> 	switch (type_req) {
> @@ -1787,6 +1788,7 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16
> value, u16 index,
> 		retval = -EPIPE;
> 	}
> 
> +unlock:
> 	spin_unlock_irqrestore(&max3421_hcd->lock, flags);
> 	return retval;
>  }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: max3421: unlock on error in max3421_hub_control()
  2017-10-27  6:26 [PATCH] usb: max3421: unlock on error in max3421_hub_control() Dan Carpenter
  2017-10-27  9:06 ` Jules Maselbas
@ 2017-10-27  9:36 ` Dan Carpenter
  2017-10-27 12:08 ` Jules Maselbas
  2017-10-27 12:16 ` Dan Carpenter
  3 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2017-10-27  9:36 UTC (permalink / raw)
  To: kernel-janitors

On Fri, Oct 27, 2017 at 11:06:36AM +0200, Jules Maselbas wrote:
> Hi,
> 
> > We can't return directly in max3421_hub_control(), we have to unlock
> > first.
> Yes you are right.
> I think testing if pdata is null is not necessary as driver_probe will fail if
> the device do not have a platform_data.
> 

In that case, let's drop my patch.  Could you send a patch for which
removes the NULL check and add a Reported-by: for me?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: max3421: unlock on error in max3421_hub_control()
  2017-10-27  6:26 [PATCH] usb: max3421: unlock on error in max3421_hub_control() Dan Carpenter
  2017-10-27  9:06 ` Jules Maselbas
  2017-10-27  9:36 ` Dan Carpenter
@ 2017-10-27 12:08 ` Jules Maselbas
  2017-10-27 12:16 ` Dan Carpenter
  3 siblings, 0 replies; 5+ messages in thread
From: Jules Maselbas @ 2017-10-27 12:08 UTC (permalink / raw)
  To: kernel-janitors


> On Fri, Oct 27, 2017 at 11:06:36AM +0200, Jules Maselbas wrote:
>> Hi,
>> 
>> > We can't return directly in max3421_hub_control(), we have to unlock
>> > first.
>> Yes you are right.
>> I think testing if pdata is null is not necessary as driver_probe will fail if
>> the device do not have a platform_data.
>> 
> 
> In that case, let's drop my patch.  Could you send a patch for which
> removes the NULL check and add a Reported-by: for me?
It is already in the v2 (and v3) of my initial patch.
https://www.spinics.net/lists/devicetree/msg199901.html

Should I make a brand new patch (not another version)?

> 
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: max3421: unlock on error in max3421_hub_control()
  2017-10-27  6:26 [PATCH] usb: max3421: unlock on error in max3421_hub_control() Dan Carpenter
                   ` (2 preceding siblings ...)
  2017-10-27 12:08 ` Jules Maselbas
@ 2017-10-27 12:16 ` Dan Carpenter
  3 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2017-10-27 12:16 UTC (permalink / raw)
  To: kernel-janitors

On Fri, Oct 27, 2017 at 02:08:38PM +0200, Jules Maselbas wrote:
> 
> > On Fri, Oct 27, 2017 at 11:06:36AM +0200, Jules Maselbas wrote:
> >> Hi,
> >> 
> >> > We can't return directly in max3421_hub_control(), we have to unlock
> >> > first.
> >> Yes you are right.
> >> I think testing if pdata is null is not necessary as driver_probe will fail if
> >> the device do not have a platform_data.
> >> 
> > 
> > In that case, let's drop my patch.  Could you send a patch for which
> > removes the NULL check and add a Reported-by: for me?
> It is already in the v2 (and v3) of my initial patch.
> https://www.spinics.net/lists/devicetree/msg199901.html
> 
> Should I make a brand new patch (not another version)?

Yeah.  Greg never rebases once the tree has been shared with the public
so you'll need to send a new patch instead of a v3.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-27 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-27  6:26 [PATCH] usb: max3421: unlock on error in max3421_hub_control() Dan Carpenter
2017-10-27  9:06 ` Jules Maselbas
2017-10-27  9:36 ` Dan Carpenter
2017-10-27 12:08 ` Jules Maselbas
2017-10-27 12:16 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox