From: David Miller <davem@davemloft.net>
To: jiazhouyang09@gmail.com
Cc: santosh@chelsio.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: cxgb3: add error handling for some functions
Date: Mon, 11 Jun 2018 14:23:21 -0700 (PDT) [thread overview]
Message-ID: <20180611.142321.1509037661741097364.davem@davemloft.net> (raw)
In-Reply-To: <1528706547-35243-1-git-send-email-jiazhouyang09@gmail.com>
From: Zhouyang Jia <jiazhouyang09@gmail.com>
Date: Mon, 11 Jun 2018 16:42:26 +0800
> When sysfs_create_group or alloc_skb fails, the lack of error-handling
> code may cause unexpected results.
>
> This patch adds error-handling code after the functions.
>
> Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com>
The ->nofail_skb handling is perfectly fine.
It is a backup SKB, meant to handle alloc_skb() failures for the
primary 'skb' allocation the _next_ time this function is called.
Even if the ->nofail_skb allocation fails, the primary operation
done by init_tp_parity() has succeeeded and we should return
success.
All of the code in this function is perfectly prepared to handle
the case where ->nofail_skb is NULL.
prev parent reply other threads:[~2018-06-11 21:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 8:42 [PATCH] net: cxgb3: add error handling for some functions Zhouyang Jia
2018-06-11 21:23 ` 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=20180611.142321.1509037661741097364.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jiazhouyang09@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=santosh@chelsio.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;
as well as URLs for NNTP newsgroup(s).