Skip to contentSkip to conversation

drm/tilcdc: Add support for external tda998x encoder

DISCUSSION Dan Carpenter 2 participants 2 messages Jun 11, 2015

lore
Share & tools
lore
#0 lore raw

Hello Jyri Sarha,

This is a semi-automatic email about new static checker warnings.

The patch 103cd8bc1c80: "drm/tilcdc: Add support for external tda998x encoder" from Feb 10, 2015, leads to the following Smatch complaint:

drivers/gpu/drm/tilcdc/tilcdc_external.c:153 tilcdc_get_external_components()
error: we previously assumed 'node' could be null (see line 148)

drivers/gpu/drm/tilcdc/tilcdc_external.c
147 node = of_graph_get_remote_port_parent(ep);

   148			if (!node && !of_device_is_available(node)) {
                             ^^^^

This test is probably reversed?

   149				of_node_put(node);
                                            ^^^^

NULL.

150 continue;
151 }
152

   153			dev_dbg(dev, "Subdevice node '%s' found\n", node->name);
                                                                    ^^^^^^^^^^^

Unchecked dereference.

   154			if (match)
   155				component_match_add(dev, match, dev_match_of, node);

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 10 lines · Dan Carpenter

Hello Jyri Sarha,

This is a semi-automatic email about new static checker warnings.

The patch 103cd8bc1c80: "drm/tilcdc: Add support for external tda998x encoder" from Feb 10, 2015, leads to the following Smatch complaint:

drivers/gpu/drm/tilcdc/tilcdc_external.c:153 tilcdc_get_external_components()
error: we previously assumed 'node' could be null (see line 148)

Quoted 7 lines

drivers/gpu/drm/tilcdc/tilcdc_external.c

    147			node = of_graph_get_remote_port_parent(ep);
    148			if (!node && !of_device_is_available(node)) {
                              ^^^^

This test is probably reversed?

Not reversed, but the && should be ||. Then we always hit the "continue", if node == NULL.

I'll make a fix for this tomorrow.

Thanks,
Jyri

Quoted 9 lines
    149				of_node_put(node);
                                             ^^^^

NULL.

    150				continue;
    151			}
    152	
    153			dev_dbg(dev, "Subdevice node '%s' found\n", node->name);
                                                                     ^^^^^^^^^^^
Quoted 8 lines

Unchecked dereference.

    154			if (match)
    155				component_match_add(dev, match, dev_match_of, node);

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel