* [PATCH] lib: Fix return check in 842_compress.c
@ 2024-12-28 7:42 Tanya Agarwal
2024-12-28 18:22 ` Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Tanya Agarwal @ 2024-12-28 7:42 UTC (permalink / raw)
To: haren; +Cc: linux-kernel, skhan, anupnewsmail, tanyaagarwal25699
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] lib: Fix return check in 842_compress.c
2024-12-28 7:42 [PATCH] lib: Fix return check in 842_compress.c Tanya Agarwal
@ 2024-12-28 18:22 ` Markus Elfring
2024-12-29 6:41 ` Tanya Agarwal
0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2024-12-28 18:22 UTC (permalink / raw)
To: Tanya Agarwal, kernel-janitors, Haren Myneni
Cc: LKML, Anup Sharma, Shuah Khan
> Add missing error handling for add_repeat_template() return value.
…
* Would the summary phrase “Improve error handling in sw842_compress()”
be more appropriate here?
* How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc4#n145
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lib: Fix return check in 842_compress.c
2024-12-28 18:22 ` Markus Elfring
@ 2024-12-29 6:41 ` Tanya Agarwal
0 siblings, 0 replies; 3+ messages in thread
From: Tanya Agarwal @ 2024-12-29 6:41 UTC (permalink / raw)
To: Markus Elfring
Cc: kernel-janitors, Haren Myneni, LKML, Anup Sharma, Shuah Khan
On Sat, Dec 28, 2024 at 11:52 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > Add missing error handling for add_repeat_template() return value.
> …
>
> * Would the summary phrase “Improve error handling in sw842_compress()”
> be more appropriate here?
>
> * How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc4#n145
Thank you Markus for reviewing.
I have incorporated these changes in v2.
Best Regards,
Tanya
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-29 6:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28 7:42 [PATCH] lib: Fix return check in 842_compress.c Tanya Agarwal
2024-12-28 18:22 ` Markus Elfring
2024-12-29 6:41 ` Tanya Agarwal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox