linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: rk_gmac_setup(): Error handling issues
Date: Mon, 11 Nov 2019 17:34:52 -0800	[thread overview]
Message-ID: <201911111734.5975EF8C@keescook> (raw)

Hello!

This is an experimental automated report about issues detected by Coverity
from a scan of next-20191108 as part of the linux-next weekly scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by recent commits:

0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings")

Coverity reported the following:

*** CID 1487850:  Error handling issues  (CHECKED_RETURN)
/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c: 1227 in rk_gmac_setup()
1221     	int value;
1222
1223     	bsp_priv = devm_kzalloc(dev, sizeof(*bsp_priv), GFP_KERNEL);
1224     	if (!bsp_priv)
1225     		return ERR_PTR(-ENOMEM);
1226
vvv     CID 1487850:  Error handling issues  (CHECKED_RETURN)
vvv     Calling "of_get_phy_mode" without checking return value (as is done elsewhere 43 out of 44 times).
1227     	of_get_phy_mode(dev->of_node, &bsp_priv->phy_iface);
1228     	bsp_priv->ops = ops;
1229
1230     	bsp_priv->regulator = devm_regulator_get_optional(dev, "phy");
1231     	if (IS_ERR(bsp_priv->regulator)) {
1232     		if (PTR_ERR(bsp_priv->regulator) == -EPROBE_DEFER) {

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1487850 ("Error handling issues")
Fixes: 0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings")


Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2019-11-12  1:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201911111734.5975EF8C@keescook \
    --to=keescook@chromium.org \
    --cc=andrew@lunn.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=gustavo@embeddedor.com \
    --cc=linux-next@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).