* fixes for ioctl() of usbtmc in testing tree
@ 2018-09-24 13:09 Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-24 13:09 UTC (permalink / raw)
To: guido; +Cc: Oliver Neukum, linux-usb
On Mon, Sep 24, 2018 at 12:20:42PM +0000, guido@kiener-muenchen.de wrote:
>
> Zitat von Oliver Neukum <oneukum@suse.com>:
>
> > On Mo, 2018-09-24 at 10:56 +0000, guido@kiener-muenchen.de wrote:
> > > Zitat von Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> > >
> > > > On Mon, Sep 24, 2018 at 11:24:10AM +0200, Oliver Neukum wrote:
> > > > > Hi,
> > > > >
> > > > > how should I mark fixes intended for the testing branch?
> > > > > I got one for the usbtmc driver.
> > > >
> > > > Just send it like normal. You can do a "Fixes:" tag with the sha1, that
> > > > should be fine. I need to push out my testing branch now, 0-day seems
> > > > to be stalled :(
> > > >
> > >
> > > Big sorry! There is a superflous kmalloc line 1270 til 1272.
> > > Shall I send the fix?
> >
> > Damn. That is the same allocation repeated, not a reuse of the buffer.
> > I'll resend. There is also a leak in the error case.
> >
>
> I do not see a leak in the error case. kfree(NULL) should be ok.
> Sorry, I referred the line 1270 to the mail of Dan Carpenter. I mean the
> lines:
>
> diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
> index 0fcb81a1399b..dfbcf418dad7 100644
> --- a/drivers/usb/class/usbtmc.c
> +++ b/drivers/usb/class/usbtmc.c
> @@ -1895,10 +1895,6 @@ static int usbtmc_ioctl_request(struct
> usbtmc_device_data *data,
> if (res)
> return -EFAULT;
>
> - buffer = kmalloc(request.req.wLength, GFP_KERNEL);
> - if (!buffer)
> - return -ENOMEM;
> -
> if (request.req.wLength > USBTMC_BUFSIZE)
> return -EMSGSIZE;
>
> @Oliver: Where do send (resend) the fix? Is this an official fix or
> do you just fix your internal build system?
> And I still have to make an official fix, isn't it?
Yes, you need to send a "real" patch for anyone to be able to pick it
up.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* fixes for ioctl() of usbtmc in testing tree
@ 2018-09-28 16:26 Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-28 16:26 UTC (permalink / raw)
To: guido; +Cc: Oliver Neukum, linux-usb
On Fri, Sep 28, 2018 at 08:30:41AM +0000, guido@kiener-muenchen.de wrote:
>
> Zitat von Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
>
> > On Mon, Sep 24, 2018 at 12:20:42PM +0000, guido@kiener-muenchen.de wrote:
> > >
> > > Zitat von Oliver Neukum <oneukum@suse.com>:
> > >
> > > > On Mo, 2018-09-24 at 10:56 +0000, guido@kiener-muenchen.de wrote:
> > > > > Zitat von Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> > > > >
> > > > > > On Mon, Sep 24, 2018 at 11:24:10AM +0200, Oliver Neukum wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > how should I mark fixes intended for the testing branch?
> > > > > > > I got one for the usbtmc driver.
> > > > > >
> > > > > > Just send it like normal. You can do a "Fixes:" tag with the
> > > sha1, that
> > > > > > should be fine. I need to push out my testing branch now, 0-day seems
> > > > > > to be stalled :(
> > > > > >
> > > > >
> > > > > Big sorry! There is a superflous kmalloc line 1270 til 1272.
> > > > > Shall I send the fix?
> > > >
> > > > Damn. That is the same allocation repeated, not a reuse of the buffer.
> > > > I'll resend. There is also a leak in the error case.
> > > >
> > >
> > > I do not see a leak in the error case. kfree(NULL) should be ok.
> > > Sorry, I referred the line 1270 to the mail of Dan Carpenter. I mean the
> > > lines:
> > >
> > > diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
> > > index 0fcb81a1399b..dfbcf418dad7 100644
> > > --- a/drivers/usb/class/usbtmc.c
> > > +++ b/drivers/usb/class/usbtmc.c
> > > @@ -1895,10 +1895,6 @@ static int usbtmc_ioctl_request(struct
> > > usbtmc_device_data *data,
> > > if (res)
> > > return -EFAULT;
> > >
> > > - buffer = kmalloc(request.req.wLength, GFP_KERNEL);
> > > - if (!buffer)
> > > - return -ENOMEM;
> > > -
> > > if (request.req.wLength > USBTMC_BUFSIZE)
> > > return -EMSGSIZE;
> > >
> > > @Oliver: Where do send (resend) the fix? Is this an official fix or
> > > do you just fix your internal build system?
> > > And I still have to make an official fix, isn't it?
> >
> > Yes, you need to send a "real" patch for anyone to be able to pick it
> > up.
>
> I sent the patch series: https://patchwork.kernel.org/cover/10612963/
> Anything else I can do to relieve my bad conscience?
All now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* fixes for ioctl() of usbtmc in testing tree
@ 2018-09-28 8:30 Guido Kiener
0 siblings, 0 replies; 4+ messages in thread
From: Guido Kiener @ 2018-09-28 8:30 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Oliver Neukum, linux-usb
Zitat von Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> On Mon, Sep 24, 2018 at 12:20:42PM +0000, guido@kiener-muenchen.de wrote:
>>
>> Zitat von Oliver Neukum <oneukum@suse.com>:
>>
>> > On Mo, 2018-09-24 at 10:56 +0000, guido@kiener-muenchen.de wrote:
>> > > Zitat von Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
>> > >
>> > > > On Mon, Sep 24, 2018 at 11:24:10AM +0200, Oliver Neukum wrote:
>> > > > > Hi,
>> > > > >
>> > > > > how should I mark fixes intended for the testing branch?
>> > > > > I got one for the usbtmc driver.
>> > > >
>> > > > Just send it like normal. You can do a "Fixes:" tag with the
>> sha1, that
>> > > > should be fine. I need to push out my testing branch now, 0-day seems
>> > > > to be stalled :(
>> > > >
>> > >
>> > > Big sorry! There is a superflous kmalloc line 1270 til 1272.
>> > > Shall I send the fix?
>> >
>> > Damn. That is the same allocation repeated, not a reuse of the buffer.
>> > I'll resend. There is also a leak in the error case.
>> >
>>
>> I do not see a leak in the error case. kfree(NULL) should be ok.
>> Sorry, I referred the line 1270 to the mail of Dan Carpenter. I mean the
>> lines:
>>
>> diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
>> index 0fcb81a1399b..dfbcf418dad7 100644
>> --- a/drivers/usb/class/usbtmc.c
>> +++ b/drivers/usb/class/usbtmc.c
>> @@ -1895,10 +1895,6 @@ static int usbtmc_ioctl_request(struct
>> usbtmc_device_data *data,
>> if (res)
>> return -EFAULT;
>>
>> - buffer = kmalloc(request.req.wLength, GFP_KERNEL);
>> - if (!buffer)
>> - return -ENOMEM;
>> -
>> if (request.req.wLength > USBTMC_BUFSIZE)
>> return -EMSGSIZE;
>>
>> @Oliver: Where do send (resend) the fix? Is this an official fix or
>> do you just fix your internal build system?
>> And I still have to make an official fix, isn't it?
>
> Yes, you need to send a "real" patch for anyone to be able to pick it
> up.
I sent the patch series: https://patchwork.kernel.org/cover/10612963/
Anything else I can do to relieve my bad conscience?
Regards,
Guido
^ permalink raw reply [flat|nested] 4+ messages in thread
* fixes for ioctl() of usbtmc in testing tree
@ 2018-09-24 12:20 Guido Kiener
0 siblings, 0 replies; 4+ messages in thread
From: Guido Kiener @ 2018-09-24 12:20 UTC (permalink / raw)
To: Oliver Neukum; +Cc: Greg Kroah-Hartman, linux-usb
Zitat von Oliver Neukum <oneukum@suse.com>:
> On Mo, 2018-09-24 at 10:56 +0000, guido@kiener-muenchen.de wrote:
>> Zitat von Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
>>
>> > On Mon, Sep 24, 2018 at 11:24:10AM +0200, Oliver Neukum wrote:
>> > > Hi,
>> > >
>> > > how should I mark fixes intended for the testing branch?
>> > > I got one for the usbtmc driver.
>> >
>> > Just send it like normal. You can do a "Fixes:" tag with the sha1, that
>> > should be fine. I need to push out my testing branch now, 0-day seems
>> > to be stalled :(
>> >
>>
>> Big sorry! There is a superflous kmalloc line 1270 til 1272.
>> Shall I send the fix?
>
> Damn. That is the same allocation repeated, not a reuse of the buffer.
> I'll resend. There is also a leak in the error case.
>
I do not see a leak in the error case. kfree(NULL) should be ok.
Sorry, I referred the line 1270 to the mail of Dan Carpenter. I mean the
lines:
@Oliver: Where do send (resend) the fix? Is this an official fix or
do you just fix your internal build system?
And I still have to make an official fix, isn't it?
Guido
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 0fcb81a1399b..dfbcf418dad7 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1895,10 +1895,6 @@ static int usbtmc_ioctl_request(struct
usbtmc_device_data *data,
if (res)
return -EFAULT;
- buffer = kmalloc(request.req.wLength, GFP_KERNEL);
- if (!buffer)
- return -ENOMEM;
-
if (request.req.wLength > USBTMC_BUFSIZE)
return -EMSGSIZE;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-28 16:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-24 13:09 fixes for ioctl() of usbtmc in testing tree Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2018-09-28 16:26 Greg Kroah-Hartman
2018-09-28 8:30 Guido Kiener
2018-09-24 12:20 Guido Kiener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).