From: Himangi Saraogi Date: Sat, 9 Aug 2014 16:40:27 +0000 (+0530) Subject: mfd: menelaus: Remove null pointer dereference X-Git-Tag: fixes-against-v3.18-rc2~69^2~66 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0c8a1f52d0d3dc5f79ce04d7bf6da0782dcee16;p=pandora-kernel.git mfd: menelaus: Remove null pointer dereference If vtg is NULL, it is not possible to access its mode_reg field. At all sites where the static function menelaus_set_voltage is called, the first argument is the address of a structure defined in the file. So, the null test is unnecessary and is removed. Also, a label is done away with. This problem was found using the following Coccinelle semantic match: // @@ expression E, E1; identifier f; statement S1,S2,S3; @@ * if (E == NULL) { ... when != if (E == NULL) S1 else S2 when != E = E1 * E->f ... when any return ...; } else S3 // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: Lee Jones --- Reading git-diff-tree failed