Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756195AbcJXKyf (ORCPT ); Mon, 24 Oct 2016 06:54:35 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:46168 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750840AbcJXKyd (ORCPT ); Mon, 24 Oct 2016 06:54:33 -0400 Date: Mon, 24 Oct 2016 13:54:03 +0300 From: Dan Carpenter To: mzoran@crowfest.net Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, daniels@collabora.com, linux-kernel@vger.kernel.org, eric@anholt.net, noralf@tronnes.org, popcornmix@gmail.com Subject: Re: [PATCH 1/2] staging: vc04_services: Fix unportable cast in vchiq_copy_from_user Message-ID: <20161024105403.GA4469@mwanda> References: <20161024052918.28205-1-mzoran@crowfest.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161024052918.28205-1-mzoran@crowfest.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1245 Lines: 32 On Sun, Oct 23, 2016 at 10:29:18PM -0700, mzoran@crowfest.net wrote: > From: Michael Zoran > > Signed-off-by: Michael Zoran > --- > drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c > index 32d12e6..98c6819 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c > @@ -219,7 +219,7 @@ remote_event_signal(REMOTE_EVENT_T *event) > int > vchiq_copy_from_user(void *dst, const void *src, int size) > { > - if ((uint32_t)src < TASK_SIZE) { > + if ((unsigned long)src < TASK_SIZE) { > return copy_from_user(dst, src, size); > } else { > memcpy(dst, src, size); This code looks totally wrong still. That's not how we differentiate kernel pointers from user pointers. Also no commit message (I tend not to read the subject) so it took me a while to figure out what was going on. Anyway, everything needs a commit message. That's a rule. regards, dan carpenter