public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Karol P <karprzy7@gmail.com>
Cc: paul@crapouillou.net, tudor.ambarus@linaro.org,
	Chris.Wulff@biamp.com, david.sands@biamp.com,
	viro@zeniv.linux.org.uk, m.grzeschik@pengutronix.de,
	peter@korsgaard.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, skhan@linuxfoundation.org
Subject: Re: [PATCH] usb: gadget: f_fs: remove unused values and add immediate returns
Date: Sun, 15 Dec 2024 12:52:49 +0100	[thread overview]
Message-ID: <2024121557-alarm-devalue-c037@gregkh> (raw)
In-Reply-To: <CAKwoAfpB-n8m7btodbH0zzTuEGiEQbDsC0aYuOfk8MSb+CFgLg@mail.gmail.com>

On Sun, Dec 15, 2024 at 12:41:03PM +0100, Karol P wrote:
> On Thu, 7 Nov 2024 at 06:15, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Nov 06, 2024 at 07:30:32PM +0100, Karol Przybylski wrote:
> > > In case of faulty copy_from_user call inside ffs_epfile_ioctl, error code is
> > > saved in a variable. However, this variable is later overwritten in every possible
> > > path, which overshadows initial assignment.
> > >
> > > This patch fixes it by returning the error code immediately and exiting the function.
> > >
> > > Error discovered in coverity scan - CID 1583682
> > >
> > > Signed-off-by: Karol Przybylski <karprzy7@gmail.com>
> > > ---
> > >  drivers/usb/gadget/function/f_fs.c | 9 +++------
> > >  1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > What commit id does this fix?
> 
> 7b07a2a7ca02a, usb: gadget: functionfs: Add DMABUF import interface

Then why not use the Fixes: tag?

> > How was this change tested?
> 
> I compiled the kernel and ran it on my machine.

Did you exercise this codepath?

> Are there other ways to reliably test such change?

Exercise the codepath by using the module and passing in a value to test
your change.

thanks,

greg k-h

      reply	other threads:[~2024-12-15 11:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 18:30 [PATCH] usb: gadget: f_fs: remove unused values and add immediate returns Karol Przybylski
2024-11-07  5:15 ` Greg KH
2024-12-15 11:41   ` Karol P
2024-12-15 11:52     ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024121557-alarm-devalue-c037@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=Chris.Wulff@biamp.com \
    --cc=david.sands@biamp.com \
    --cc=karprzy7@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=paul@crapouillou.net \
    --cc=peter@korsgaard.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox