Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757817AbbKSHSO (ORCPT ); Thu, 19 Nov 2015 02:18:14 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:38328 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756115AbbKSHSN (ORCPT ); Thu, 19 Nov 2015 02:18:13 -0500 MIME-Version: 1.0 In-Reply-To: <1446013604-15017-1-git-send-email-saurabh.truth@gmail.com> References: <1446013604-15017-1-git-send-email-saurabh.truth@gmail.com> Date: Thu, 19 Nov 2015 12:48:12 +0530 Message-ID: Subject: Re: [PATCH] tty/vt/keyboard: use memdup_user to simplify code From: Saurabh Sengar To: Greg KH , jslaby@suse.com, linux-kernel@vger.kernel.org Cc: Saurabh Sengar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 47 On 28 October 2015 at 11:56, Saurabh Sengar wrote: > use memdup_user rather than duplicating implementation. > found by coccinelle > > Signed-off-by: Saurabh Sengar > --- > drivers/tty/vt/keyboard.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c > index 6f0336f..f973bfc 100644 > --- a/drivers/tty/vt/keyboard.c > +++ b/drivers/tty/vt/keyboard.c > @@ -1706,16 +1706,12 @@ int vt_do_diacrit(unsigned int cmd, void __user *udp, int perm) > return -EINVAL; > > if (ct) { > - dia = kmalloc(sizeof(struct kbdiacr) * ct, > - GFP_KERNEL); > - if (!dia) > - return -ENOMEM; > > - if (copy_from_user(dia, a->kbdiacr, > - sizeof(struct kbdiacr) * ct)) { > - kfree(dia); > - return -EFAULT; > - } > + dia = memdup_user(a->kbdiacr, > + sizeof(struct kbdiacr) * ct); > + if (IS_ERR(dia)) > + return PTR_ERR(dia); > + > } > > spin_lock_irqsave(&kbd_event_lock, flags); > -- > 1.9.1 > Hi, Is this patch rejected for some reason or is still in queue? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/