Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933807AbbFWOLv (ORCPT ); Tue, 23 Jun 2015 10:11:51 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:34102 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933012AbbFWOL1 convert rfc822-to-8bit (ORCPT ); Tue, 23 Jun 2015 10:11:27 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: [PATCH 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors From: Dmitry Kalinkin In-Reply-To: <20150623135124.GP28762@mwanda> Date: Tue, 23 Jun 2015 17:13:56 +0300 Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Martyn Welch , Greg Kroah-Hartman , Manohar Vanga Content-Transfer-Encoding: 8BIT Message-Id: <9B1D63B1-7363-42DC-8F91-71C9660F3A0C@gmail.com> References: <1435063353-25914-1-git-send-email-dmitry.kalinkin@gmail.com> <1435063353-25914-7-git-send-email-dmitry.kalinkin@gmail.com> <20150623135124.GP28762@mwanda> To: Dan Carpenter X-Mailer: Apple Mail (2.2098) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 755 Lines: 23 > On 23 Jun 2015, at 16:51, Dan Carpenter wrote: > > On Tue, Jun 23, 2015 at 03:42:30PM +0300, Dmitry Kalinkin wrote: >> @@ -178,38 +167,24 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf, >> size_t count, loff_t *ppos) >> { >> void *image_ptr; >> - ssize_t retval; >> >> image_ptr = image[minor].kern_buf + *ppos; >> + if (__copy_to_user(buf, image_ptr, (unsigned long)count)) >> + return -EINVAL; > > s/EINVAL/EFAULT/ Right. Will fix in v2. -- 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/