public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daeseok Youn <daeseok.youn@gmail.com>,
	driverdev-devel@linuxdriverproject.org,
	Lidza Louina <lidza.louina@gmail.com>
Subject: Re: [PATCH] staging: dgap: fix returned errno code in dgap_parsefile()
Date: Tue, 22 Sep 2015 08:38:43 +0200	[thread overview]
Message-ID: <5600F773.5040208@osg.samsung.com> (raw)
In-Reply-To: <20150922045238.GA5526@sudip-pc>

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?

I meant whatever function calls dgap_parsefile(), which currently is
only dgap_firmware_load().

> 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().
>

Yes, I also verified what dgap_firmware_load() does with the returned error
code to make sure that it was safe to do this change without affecting the
rest of the driver.

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.
 
> regards
> sudip
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

  reply	other threads:[~2015-09-22  6:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22  0:39 [PATCH] staging: dgap: fix returned errno code in dgap_parsefile() Javier Martinez Canillas
2015-09-22  4:52 ` Sudip Mukherjee
2015-09-22  6:38   ` Javier Martinez Canillas [this message]
2015-09-22  6:52     ` Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5600F773.5040208@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=daeseok.youn@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lidza.louina@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox