All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [bug report] [media] davinci: vpif_capture: get subdevs from DT when available
Date: Tue, 11 Jul 2017 12:09:31 -0700	[thread overview]
Message-ID: <7hfue2vlhw.fsf@baylibre.com> (raw)
In-Reply-To: <20170711130838.wsz63nclcrtxnbsm@mwanda> (Dan Carpenter's message of "Tue, 11 Jul 2017 16:08:38 +0300")

Dan Carpenter <dan.carpenter@oracle.com> writes:

> Hello Kevin Hilman,
>
> The patch 4a5f8ae50b66: "[media] davinci: vpif_capture: get subdevs
> from DT when available" from Jun 6, 2017, leads to the following
> static checker warning:
>
> 	drivers/media/platform/davinci/vpif_capture.c:1596 vpif_capture_get_pdata()
> 	error: potential NULL dereference 'pdata'.
>
> drivers/media/platform/davinci/vpif_capture.c
>   1576  
>   1577                  dev_dbg(&pdev->dev, "Remote device %s, %s found\n",
>   1578                          rem->name, rem->full_name);
>   1579                  sdinfo->name = rem->full_name;
>   1580  
>   1581                  pdata->asd[i] = devm_kzalloc(&pdev->dev,
>   1582                                               sizeof(struct v4l2_async_subdev),
>   1583                                               GFP_KERNEL);
>   1584                  if (!pdata->asd[i]) {
>   1585                          of_node_put(rem);
>   1586                          pdata = NULL;
>                                 ^^^^^^^^^^^^
> Set to NULL
>
>   1587                          goto done;
>   1588                  }
>   1589  
>   1590                  pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_FWNODE;
>   1591                  pdata->asd[i]->match.fwnode.fwnode = of_fwnode_handle(rem);
>   1592                  of_node_put(rem);
>   1593          }
>   1594  
>   1595  done:
>   1596          pdata->asd_sizes[0] = i;
>                 ^^^^^^^^^^^^^^^^
> Dereference.
>
>   1597          pdata->subdev_count = i;
>   1598          pdata->card_name = "DA850/OMAP-L138 Video Capture";
>   1599  
>   1600          return pdata;
>   1601  }
>

Thanks for the bug report.  Fix submitted:
https://patchwork.linuxtv.org/patch/42433/

Kevin

      reply	other threads:[~2017-07-11 19:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 13:08 [bug report] [media] davinci: vpif_capture: get subdevs from DT when available Dan Carpenter
2017-07-11 19:09 ` Kevin Hilman [this message]

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=7hfue2vlhw.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.