dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* re: drm: rcar-du: Clarify error message when encoder initialization fails
@ 2015-06-26  9:47 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-06-26  9:47 UTC (permalink / raw)
  To: laurent.pinchart+renesas; +Cc: dri-devel

Hello Laurent Pinchart,

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

The patch 64549cdf85a1: "drm: rcar-du: Clarify error message when 
encoder initialization fails" from May 26, 2015, leads to the 
following Smatch complaint:

drivers/gpu/drm/rcar-du/rcar_du_kms.c:651 rcar_du_encoders_init_one()
	 error: we previously assumed 'encoder' could be null (see line 613)

drivers/gpu/drm/rcar-du/rcar_du_kms.c
   612	
   613		if (encoder) {
                    ^^^^^^^
Check for NULL.

   614			/*
   615			 * If an encoder has been found, get its type based on its
   616			 * compatible string.
   617			 */
   618			unsigned int i;
   619	
   620			for (i = 0; i < ARRAY_SIZE(encoders); ++i) {
   621				if (of_device_is_compatible(encoder,
   622							    encoders[i].compatible)) {
   623					enc_type = encoders[i].type;
   624					break;
   625				}
   626			}
   627	
   628			if (i == ARRAY_SIZE(encoders)) {
   629				dev_warn(rcdu->dev,
   630					 "unknown encoder type for %s, skipping\n",
   631					 encoder->full_name);
   632				of_node_put(encoder);
   633				of_node_put(connector);
   634				return -EINVAL;
   635			}
   636		} else {
   637			/*
   638			 * If no encoder has been found the entity must be the
   639			 * connector.
   640			 */
   641			connector = entity;
   642		}
   643	
   644		ret = rcar_du_encoder_init(rcdu, enc_type, output, encoder, connector);
   645		of_node_put(encoder);
                            ^^^^^^^
Free?

   646		of_node_put(connector);
   647	
   648		if (ret && ret != -EPROBE_DEFER)
   649			dev_warn(rcdu->dev,
   650				 "failed to initialize encoder %s (%d), skipping\n",
   651				 encoder->full_name, ret);
                                 ^^^^^^^^^^^^^^^^^^
Unchecked dereference.

   652	
   653		return ret;

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-26  9:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26  9:47 drm: rcar-du: Clarify error message when encoder initialization fails Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox