From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757261AbbIVGwr (ORCPT ); Tue, 22 Sep 2015 02:52:47 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33471 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757189AbbIVGwn (ORCPT ); Tue, 22 Sep 2015 02:52:43 -0400 Date: Tue, 22 Sep 2015 12:22:36 +0530 From: Sudip Mukherjee To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Greg Kroah-Hartman , Daeseok Youn , driverdev-devel@linuxdriverproject.org, Lidza Louina Subject: Re: [PATCH] staging: dgap: fix returned errno code in dgap_parsefile() Message-ID: <20150922065236.GB5526@sudip-pc> References: <1442882376-23634-1-git-send-email-javier@osg.samsung.com> <20150922045238.GA5526@sudip-pc> <5600F773.5040208@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5600F773.5040208@osg.samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2015 at 08:38:43AM +0200, Javier Martinez Canillas wrote: > Hello Sudip, > > On 09/22/2015 06:52 AM, Sudip Mukherjee wrote: > > On Tue, Sep 22, 2015 at 02:39:36AM +0200, Javier Martinez Canillas wrote: > >> The driver is using -1 instead of the -ENOMEM defined macro to specify > >> that a buffer allocation failed. Since the error number is propagated, > >> the caller will get a -EPERM which is the wrong error condition. > > Just a little doubt. caller means the function which is calling this > > dgap_parsefile() or you meant the user? > > But I believe the patch and what the commit message says is true regardless > of the fact that the caller is just checking for != 0. dgap_firmware_load() > stills gets a wrong error condition whether it's checking it or not. Yes. I just had a doubt what you meant by caller. If user then I would have said that "patch is correct but commit message is not". :) regards sudip