misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write
authorSu Hui <suhui@nfschina.com>
Mon, 20 Nov 2023 09:55:26 +0000 (17:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Nov 2023 13:38:29 +0000 (13:38 +0000)
Clang static analyzer complains that value stored to 'rets' is never
read.Let 'buf_len = -EOVERFLOW' to make sure we can return '-EOVERFLOW'.

Fixes: 8c8d964ce90f ("mei: move hbuf_depth from the mei device to the hw modules")
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231120095523.178385-2-suhui@nfschina.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c

index 7ea80779a0e22ff3d2f49f92db5ba4b6af2b2d98..9d090fa07516f06a567c0308c995393e57239010 100644 (file)
@@ -2032,7 +2032,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, unsigned long time
 
        hbuf_slots = mei_hbuf_empty_slots(dev);
        if (hbuf_slots < 0) {
-               rets = -EOVERFLOW;
+               buf_len = -EOVERFLOW;
                goto out;
        }