]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib: 842: Improve error handling in sw842_compress()
authorTanya Agarwal <tanyaagarwal25699@gmail.com>
Tue, 14 Jan 2025 14:12:04 +0000 (19:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:32:00 +0000 (14:32 +0200)
commit3b619f2803284d1814a3830c3cb649086aea660c
tree3a7f0c447dabe174eee044ed87957a9b37d06971
parenteba7778cf9b977329bec485337aa56599f911ebf
lib: 842: Improve error handling in sw842_compress()

[ Upstream commit af324dc0e2b558678aec42260cce38be16cc77ca ]

The static code analysis tool "Coverity Scan" pointed the following
implementation details out for further development considerations:
CID 1309755: Unused value
In sw842_compress: A value assigned to a variable is never used. (CWE-563)
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.

Conclusion:
Add error handling for the return value from an add_repeat_template()
call.

Fixes: 2da572c959dd ("lib: add software 842 compression/decompression")
Signed-off-by: Tanya Agarwal <tanyaagarwal25699@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
lib/842/842_compress.c