[media] m5mols: Fix logic in sanity check
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 15 Oct 2011 21:38:40 +0000 (18:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 11 Dec 2011 14:08:21 +0000 (12:08 -0200)
Detected by "cppcheck".

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/m5mols/m5mols_core.c

index 68497f8ddcd948cdb91f4560c19071a0c4c2d54f..5da8d74df5088ab97bdef40e3bfd53d93d190791 100644 (file)
@@ -333,7 +333,7 @@ int m5mols_mode(struct m5mols_info *info, u8 mode)
        int ret = -EINVAL;
        u8 reg;
 
-       if (mode < REG_PARAMETER && mode > REG_CAPTURE)
+       if (mode < REG_PARAMETER || mode > REG_CAPTURE)
                return ret;
 
        ret = m5mols_read_u8(sd, SYSTEM_SYSMODE, &reg);