netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: Yuval.Mintz@cavium.com
Cc: bianpan201603@163.com, netdev@vger.kernel.org, Ariel.Elior@cavium.com
Subject: Re: [PATCH 1/1] net: ethernet: qlogic: set error code on failure
Date: Mon, 05 Dec 2016 14:55:16 -0500 (EST)	[thread overview]
Message-ID: <20161205.145516.846922633542908155.davem@davemloft.net> (raw)
In-Reply-To: <BL2PR07MB2306060C02F0A19BD735EBE28D800@BL2PR07MB2306.namprd07.prod.outlook.com>

From: "Mintz, Yuval" <Yuval.Mintz@cavium.com>
Date: Sun, 4 Dec 2016 07:29:58 +0000

>> From: Pan Bian <bianpan2016@163.com>
>> 
>> When calling dma_mapping_error(), the value of return variable rc is 0.
>> And when the call returns an unexpected value, rc is not set to a negative
>> errno. Thus, it will return 0 on the error path, and its callers cannot detect
>> the bug. This patch fixes the bug, assigning "-ENOMEM" to err.
>> 
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189041
>> 
>> Signed-off-by: Pan Bian <bianpan2016@163.com>
> 
> The title should have been "[PATCH net 1/1] qed: Set error code on failure".
> 
> But the fix itself is sound. Thanks.
> BTW, is -ENOMEM the right return code in case of DMA mapping errors?
> 
> Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>

Applied.

Indeed, -ENOMEM is usually the right thing to use for DMA mapping errors.
Because usually the error is because we're run out of IOMMU resources
or similar.  And -ENOMEM is pretty much the error code which maps most
closely to that situation.

      reply	other threads:[~2016-12-05 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-04  5:53 [PATCH 1/1] net: ethernet: qlogic: set error code on failure Pan Bian
2016-12-04  7:29 ` Mintz, Yuval
2016-12-05 19:55   ` David Miller [this message]

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=20161205.145516.846922633542908155.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Ariel.Elior@cavium.com \
    --cc=Yuval.Mintz@cavium.com \
    --cc=bianpan201603@163.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).