From: Marco Felsch <m.felsch@pengutronix.de>
To: kbuild-all@lists.01.org
Subject: Re: [pengutronix:v5.6/topic/tvp5150.12-media 5/18] drivers/media/v4l2-core/v4l2-fwnode.c:747 v4l2_fwnode_connector_add_link() warn: possible memory leak of 'link'
Date: Thu, 12 Mar 2020 08:15:01 +0100 [thread overview]
Message-ID: <20200312071501.ecjn3tkmkbjpbbv6@pengutronix.de> (raw)
In-Reply-To: <20200311143657.GE11561@kadam>
[-- Attachment #1: Type: text/plain, Size: 3803 bytes --]
Hi Dan,
On 20-03-11 17:36, Dan Carpenter wrote:
> tree: https://git.pengutronix.de/git/linux-0-day v5.6/topic/tvp5150.12-media
> head: 818c7a29eb379034bf0f85ff6a6b8c1b7203d17e
> commit: 4c342a5cce960384eef333b906aa3d4207a7b7e7 [5/18] media: v4l2-fwnode: add initial connector parsing support
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/media/v4l2-core/v4l2-fwnode.c:747 v4l2_fwnode_connector_add_link() warn: possible memory leak of 'link'
>
> git remote add pengutronix https://git.pengutronix.de/git/linux-0-day
> git remote update pengutronix
> git checkout 4c342a5cce960384eef333b906aa3d4207a7b7e7
> vim +/link +747 drivers/media/v4l2-core/v4l2-fwnode.c
Thanks for the report, Hans already told me that and I prepared a v13.
Regards,
Marco
> 4c342a5cce9603 Marco Felsch 2019-01-30 731 int v4l2_fwnode_connector_add_link(struct fwnode_handle *fwnode,
> 4c342a5cce9603 Marco Felsch 2019-01-30 732 struct v4l2_fwnode_connector *connector)
> 4c342a5cce9603 Marco Felsch 2019-01-30 733 {
> 4c342a5cce9603 Marco Felsch 2019-01-30 734 struct fwnode_handle *connector_ep;
> 4c342a5cce9603 Marco Felsch 2019-01-30 735 struct v4l2_connector_link *link;
> 4c342a5cce9603 Marco Felsch 2019-01-30 736 int err;
> 4c342a5cce9603 Marco Felsch 2019-01-30 737
> 4c342a5cce9603 Marco Felsch 2019-01-30 738 if (!fwnode || !connector || connector->type == V4L2_CONN_UNKNOWN)
> 4c342a5cce9603 Marco Felsch 2019-01-30 739 return -EINVAL;
> 4c342a5cce9603 Marco Felsch 2019-01-30 740
> 4c342a5cce9603 Marco Felsch 2019-01-30 741 link = kzalloc(sizeof(*link), GFP_KERNEL);
> 4c342a5cce9603 Marco Felsch 2019-01-30 742 if (!link)
> 4c342a5cce9603 Marco Felsch 2019-01-30 743 return -ENOMEM;
> 4c342a5cce9603 Marco Felsch 2019-01-30 744
> 4c342a5cce9603 Marco Felsch 2019-01-30 745 connector_ep = fwnode_graph_get_remote_endpoint(fwnode);
> 4c342a5cce9603 Marco Felsch 2019-01-30 746 if (!connector_ep)
> 4c342a5cce9603 Marco Felsch 2019-01-30 @747 return -ENOTCONN;
>
> kfree(link);
>
> 4c342a5cce9603 Marco Felsch 2019-01-30 748
> 4c342a5cce9603 Marco Felsch 2019-01-30 749 err = v4l2_fwnode_parse_link(connector_ep, &link->fwnode_link);
> 4c342a5cce9603 Marco Felsch 2019-01-30 750 if (err)
> 4c342a5cce9603 Marco Felsch 2019-01-30 751 goto err;
> 4c342a5cce9603 Marco Felsch 2019-01-30 752
> 4c342a5cce9603 Marco Felsch 2019-01-30 753 fwnode_handle_put(connector_ep);
> 4c342a5cce9603 Marco Felsch 2019-01-30 754
> 4c342a5cce9603 Marco Felsch 2019-01-30 755 list_add(&link->head, &connector->links);
> 4c342a5cce9603 Marco Felsch 2019-01-30 756 connector->nr_of_links++;
> 4c342a5cce9603 Marco Felsch 2019-01-30 757
> 4c342a5cce9603 Marco Felsch 2019-01-30 758 return 0;
> 4c342a5cce9603 Marco Felsch 2019-01-30 759
> 4c342a5cce9603 Marco Felsch 2019-01-30 760 err:
> 4c342a5cce9603 Marco Felsch 2019-01-30 761 kfree(link);
> 4c342a5cce9603 Marco Felsch 2019-01-30 762 fwnode_handle_put(connector_ep);
> 4c342a5cce9603 Marco Felsch 2019-01-30 763
> 4c342a5cce9603 Marco Felsch 2019-01-30 764 return err;
> 4c342a5cce9603 Marco Felsch 2019-01-30 765 }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2020-03-12 7:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 14:36 [pengutronix:v5.6/topic/tvp5150.12-media 5/18] drivers/media/v4l2-core/v4l2-fwnode.c:747 v4l2_fwnode_connector_add_link() warn: possible memory leak of 'link' Dan Carpenter
2020-03-11 14:36 ` Dan Carpenter
2020-03-12 7:15 ` Marco Felsch [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=20200312071501.ecjn3tkmkbjpbbv6@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=kbuild-all@lists.01.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.