[PATCH 8/8] pcmcia: handle __copy_from_user() return value in ioctl
Dominik Brodowski
linux at dominikbrodowski.net
Sun Nov 19 23:12:42 EST 2006
On Sun, Nov 19, 2006 at 10:09:26AM -0800, Randy Dunlap wrote:
> Dominik Brodowski wrote:
> > From: Dominik Brodowski <linux at dominikbrodowski.net>
> > Date: Sun, 19 Nov 2006 11:21:27 -0500
> > Subject: [PATCH] pcmcia: handle __copy_from_user() return value in ioctl
> >
> > Handle __copy_from_user() return value.
> >
> > drivers/pcmcia/pcmcia_ioctl.c:597: warning: ignoring return value of '__copy_from_user', declared with attribute warn_unused_result
> >
> > Noticed and first fix by Randy Dunlap.
> >
> > Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
> > ---
> > drivers/pcmcia/pcmcia_ioctl.c | 7 ++++++-
> > 1 files changed, 6 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
> > index 310ede5..6383a39 100644
> > --- a/drivers/pcmcia/pcmcia_ioctl.c
> > +++ b/drivers/pcmcia/pcmcia_ioctl.c
> > @@ -594,7 +594,12 @@ static int ds_ioctl(struct inode * inode
> >
> > err = ret = 0;
> >
> > - if (cmd & IOC_IN) __copy_from_user((char *)buf, uarg, size);
> > + if (cmd & IOC_IN) {
> > + if (__copy_from_user((char *)buf, uarg, size)) {
> > + ret = -EFAULT;
>
> Ack, except:
>
> s/ret/err/
> since free_out: returns err;
Right, thanks for noticing this. Updated the patch accordingly.
Dominik
More information about the linux-pcmcia
mailing list