From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wim de With <nauxuron@wimdewith.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gdm72xx: add userspace data struct
Date: Thu, 10 Dec 2015 12:37:20 +0300 [thread overview]
Message-ID: <20151210093720.GD5284@mwanda> (raw)
In-Reply-To: <1449738672-24429-1-git-send-email-nauxuron@wimdewith.com>
On Thu, Dec 10, 2015 at 10:11:12AM +0100, Wim de With wrote:
> @@ -482,8 +483,16 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> /* NOTE: gdm_update_fsm should be called
> * before gdm_wimax_ioctl_set_data is called.
> */
> - gdm_update_fsm(dev,
> - req->data.buf);
> + fsm_buf = kmalloc(sizeof(fsm_s), GFP_KERNEL);
> + if (!fsm_buf)
> + return -ENOMEM;
> + if (copy_from_user(fsm_buf, req->data.buf,
> + sizeof(fsm_s))) {
> + kfree(fsm_buf);
> + return -EFAULT;
> + }
> + gdm_update_fsm(dev, fsm_buf);
> + kfree(fsm_buf);
No. This change is a bug.
regards,
dan carpenter
next prev parent reply other threads:[~2015-12-10 9:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 9:11 [PATCH] staging: gdm72xx: add userspace data struct Wim de With
2015-12-10 9:37 ` Dan Carpenter [this message]
2015-12-10 9:42 ` Wim de With
2015-12-10 11:34 ` Dan Carpenter
2015-12-10 11:40 ` [PATCH v2] " Wim de With
2015-12-10 14:44 ` One Thousand Gnomes
2015-12-10 23:47 ` Wim de With
2015-12-11 0:17 ` One Thousand Gnomes
2015-12-11 9:25 ` [PATCH v3] " Wim de With
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=20151210093720.GD5284@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nauxuron@wimdewith.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.