From: Dan Carpenter <dan.carpenter@oracle.com>
To: laurent.pinchart+renesas@ideasonboard.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm: rcar-du: Clarify error message when encoder initialization fails
Date: Fri, 26 Jun 2015 12:47:54 +0300 [thread overview]
Message-ID: <20150626094754.GA30427@mwanda> (raw)
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
reply other threads:[~2015-06-26 9:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150626094754.GA30427@mwanda \
--to=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox