Skip to content
Commit c0fd916f authored by Jared Kangas's avatar Jared Kangas Committed by Alberto Escolar
Browse files

drivers: sensor: wsen_itds: fix device ID mismatch return value



During initialization, zero is returned if an unexpected device ID is
read because the returned variable is not written to after a previous
non-zero check. Return -EIO instead to indicate an error occurred.

Detected with the following Coccinelle script:

        @@
        identifier I;
        @@

        *if (I) {
             ...
             return ...;
         }

         if (...) {
             ... when != I
                 when any
        *    return I;
         }

Signed-off-by: default avatarJared Kangas <kangas.jd@gmail.com>
parent 62da8152
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment