On Mon, May 04, 2020 at 03:22:08PM +0000, Christian.Gromm@xxxxxxxxxxxxx wrote: > On Mon, 2020-05-04 at 15:55 +0200, Greg KH wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you > > know the content is safe > > > > On Mon, May 04, 2020 at 03:44:00PM +0200, Christian Gromm wrote: > > > This patch fixes error handling on function parameters. > > > > > > Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx> > > > --- > > > drivers/staging/most/usb/usb.c | 33 +++++++++++++++++------------- > > > --- > > > 1 file changed, 17 insertions(+), 16 deletions(-) > > > > > > diff --git a/drivers/staging/most/usb/usb.c > > > b/drivers/staging/most/usb/usb.c > > > index e8c5a8c..e5276524 100644 > > > --- a/drivers/staging/most/usb/usb.c > > > +++ b/drivers/staging/most/usb/usb.c > > > @@ -229,14 +229,14 @@ static unsigned int > > > get_stream_frame_size(struct most_channel_config *cfg) > > > */ > > > static int hdm_poison_channel(struct most_interface *iface, int > > > channel) > > > { > > > - struct most_dev *mdev = to_mdev(iface); > > > + struct most_dev *mdev; > > > unsigned long flags; > > > spinlock_t *lock; /* temp. lock */ > > > > > > if (unlikely(!iface)) { > > > - dev_warn(&mdev->usb_device->dev, "Poison: Bad > > > interface.\n"); > > > - return -EIO; > > > + return -EFAULT; > > > > -EFAULT is ONLY for when you have an error with copying memory > > to/from > > userspace. > > Ok. > > > > > This should just be -EINVAL, right? > > > > And how can iface ever be NULL? > > It should never become NULL. But you never know, right? > Too paranoid? Yes, never check things that can not happen otherwise all functions would be nothing but checking parameters all the time. So just drop this check entirely. thanks, greg k-h _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel