Skip to contentSkip to conversation

video: fbdev: matrox: the list iterator can't be NULL

PATCH New Dan Carpenter 1 participant 1 message Jun 30, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: fbdev: matrox: the list iterator can't be NULL

My static checker is complaining because we check "drv" for NULL and then we dereference it to get the next item in the list. It can't be NULL so we can remove this check.

drivers/video/fbdev/matrox/matroxfb_base.c +1 -1
index 11eb094396ae..f6a0b9af97a9 100644
@@ -2001,7 +2001,7 @@ static void matroxfb_register_device(struct matrox_fb_info* minfo) {
 	for (drv = matroxfb_driver_l(matroxfb_driver_list.next);
 	     drv != matroxfb_driver_l(&matroxfb_driver_list);
 	     drv = matroxfb_driver_l(drv->node.next)) {
-		if (drv && drv->probe) {
+		if (drv->probe) {
 			void *p = drv->probe(minfo);
 			if (p) {
 				minfo->drivers_data[i] = p;