From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757459AbbIVEw4 (ORCPT ); Tue, 22 Sep 2015 00:52:56 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33383 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753142AbbIVEwz (ORCPT ); Tue, 22 Sep 2015 00:52:55 -0400 Date: Tue, 22 Sep 2015 10:22:38 +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: <20150922045238.GA5526@sudip-pc> References: <1442882376-23634-1-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442882376-23634-1-git-send-email-javier@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 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? The function which is calling this dgap_parsefile() is just checking if it has received 0 or something else. Something else is error and it rerturns -EINVAL for all types of error (ofcourse that is also wrong). So the user will see -EINVAL for all types of error in dgap_parsefile(). regards sudip