All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 06/17] reset: Avoid a warning in devm_reset_bulk_get_by_node()
Date: Sat,  8 May 2021 16:00:10 -0600	[thread overview]
Message-ID: <20210508220021.1778080-7-sjg@chromium.org> (raw)
In-Reply-To: <20210508220021.1778080-1-sjg@chromium.org>

The devres_alloc() function is intended to avoid the need for freeing
memory, although in practice it may not be enabled, thus leading to a true
leak.

Nevertheless this is intended. Add a comment to molify Coverity.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 312952)
---

 drivers/reset/reset-uclass.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c
index ac89eaf098a..668b8cb9420 100644
--- a/drivers/reset/reset-uclass.c
+++ b/drivers/reset/reset-uclass.c
@@ -323,6 +323,8 @@ struct reset_ctl_bulk *devm_reset_bulk_get_by_node(struct udevice *dev,
 	bulk = devres_alloc(devm_reset_bulk_release,
 			    sizeof(struct reset_ctl_bulk),
 			    __GFP_ZERO);
+
+	/* coverity[RESOURCE_LEAK] */
 	if (unlikely(!bulk))
 		return ERR_PTR(-ENOMEM);
 
-- 
2.31.1.607.g51e8a6a459-goog

  parent reply	other threads:[~2021-05-08 22:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 22:00 [PATCH 00/17] Fix various coverity warnings Simon Glass
2021-05-08 22:00 ` [PATCH 01/17] sandbox: net: Ensure host name is always a valid string Simon Glass
2021-05-09  4:14   ` Ramon Fried
2021-05-08 22:00 ` [PATCH 02/17] video: Check return value in pwm_backlight_of_to_plat() Simon Glass
2021-05-08 22:00 ` [PATCH 03/17] sandbox: Indicate NULL-pointer access in 'sigsegv' command Simon Glass
2021-05-10 13:07   ` Tom Rini
2021-05-08 22:00 ` [PATCH 04/17] test: Rename final check in setexpr_test_backref() Simon Glass
2021-05-08 22:00 ` [PATCH 05/17] tools: Avoid showing return value of clock_gettime() Simon Glass
2021-05-08 22:00 ` Simon Glass [this message]
2021-05-08 22:00 ` [PATCH 07/17] reset: Avoid a warning in devm_regmap_init() Simon Glass
2021-05-10  7:29   ` Pratyush Yadav
2021-05-08 22:00 ` [PATCH 08/17] test: Avoid random numbers in dm_test_devm_regmap() Simon Glass
2021-05-08 22:00 ` [PATCH 09/17] dm: core: Check uclass_get() return value when dumping Simon Glass
2021-05-08 22:00 ` [PATCH 10/17] sandbox: scmi: Indicate dead code for coverity Simon Glass
2021-05-08 22:00 ` [PATCH 11/17] sandbox: cros_ec: Update error handling when reading matrix Simon Glass
2021-05-08 22:00 ` [PATCH 12/17] cbfs: Check offset range when reading a file Simon Glass
2021-05-08 22:00 ` [PATCH 13/17] pinctrl: Avoid coverity warning when checking width Simon Glass
2021-05-08 22:00 ` [PATCH 14/17] tpm: Check outgoing command size Simon Glass
2021-05-08 22:00 ` [PATCH 15/17] sandbox: Silence coverity warning in state_read_file() Simon Glass
2021-05-08 22:00 ` [PATCH 16/17] clk: Detect failure to set defaults Simon Glass
2021-05-09  0:40   ` Sean Anderson
2021-05-10 16:28     ` Simon Glass
2021-05-10 23:28       ` Sean Anderson
2021-05-08 22:00 ` [PATCH 17/17] RFC: clk: Return error code from clk_set_default_get_by_id() Simon Glass

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=20210508220021.1778080-7-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.