utils: get_cmdline_val: add missing error check
authorDaniel Golle <daniel@makrotopia.org>
Sat, 30 Mar 2024 13:07:29 +0000 (13:07 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 1 Jul 2024 17:13:59 +0000 (18:13 +0100)
commit1e411a58f52ea49e5cb4ef4a067ecdab8befd55c
treeaad6814c17746a7b3266b99cd63caf41798502f2
parent946552a7b598a0b88db6101e864679554ec4f221
utils: get_cmdline_val: add missing error check

Add check to prevent read() in case open() has failed.

Coverity CID: 1595922: Error handling issues  (NEGATIVE_RETURNS)
Fixes: 6f52ef3 ("get_cmdline_val: search for entire name, not just suffix")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
utils/utils.c