mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tanya Agarwal <tanyaagarwal25699@gmail.com>
To: haren@us.ibm.com
Cc: linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
	anupnewsmail@gmail.com, tanyaagarwal25699@gmail.com
Subject: [PATCH] lib: Fix return check in 842_compress.c
Date: Sat, 28 Dec 2024 13:12:46 +0530	[thread overview]
Message-ID: <20241228074246.3572-1-tanyaagarwal25699@gmail.com> (raw)

From: Tanya Agarwal <tanyaagarwal25699@gmail.com>

Add missing error handling for add_repeat_template() return value.
Note that this error case is already properly handled later in other
add_repeat_template() function calls.

CID 1309755: (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from add_repeat_template(p, repeat_count)
to ret here, but that stored value is overwritten before it can be used.

Coverity Link:
https://scan5.scan.coverity.com/#/project-view/63683/10063?selectedIssue=1309755

Signed-off-by: Tanya Agarwal <tanyaagarwal25699@gmail.com>
---
 lib/842/842_compress.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/842/842_compress.c b/lib/842/842_compress.c
index c02baa4168e1..055356508d97 100644
--- a/lib/842/842_compress.c
+++ b/lib/842/842_compress.c
@@ -532,6 +532,8 @@ int sw842_compress(const u8 *in, unsigned int ilen,
 		}
 		if (repeat_count) {
 			ret = add_repeat_template(p, repeat_count);
+			if (ret)
+				return ret;
 			repeat_count = 0;
 			if (next == last) /* reached max repeat bits */
 				goto repeat;
-- 
2.39.5


             reply	other threads:[~2024-12-28  7:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-28  7:42 Tanya Agarwal [this message]
2024-12-28 18:22 ` Markus Elfring
2024-12-29  6:41   ` Tanya Agarwal

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=20241228074246.3572-1-tanyaagarwal25699@gmail.com \
    --to=tanyaagarwal25699@gmail.com \
    --cc=anupnewsmail@gmail.com \
    --cc=haren@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.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

all inboxes | Powered by JetHome®