From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Daniel Scally <djrscally@gmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Yong Zhi <yong.zhi@intel.com>, Bingbu Cao <bingbu.cao@intel.com>,
Tianshu Qiu <tian.shu.qiu@intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH v1 1/1] media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor()
Date: Mon, 26 Jul 2021 14:44:33 +0300 [thread overview]
Message-ID: <20210726114433.GB3@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20210726084055.54887-1-andriy.shevchenko@linux.intel.com>
Hi Andy,
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
> The commit 71f642833284 ("ACPI: utils: Fix reference counting in
> for_each_acpi_dev_match()") moved adev assignment outside of error
> path and hence made acpi_dev_put(sensor->adev) a no-op. We still
> need to drop reference count on error path, and to achieve that,
> replace sensor->adev by locally assigned adev.
>
> Fixes: 71f642833284 ("ACPI: utils: Fix reference counting in for_each_acpi_dev_match()")
> Depends-on: fc68f42aa737 ("ACPI: fix NULL pointer dereference")
> Reported-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/media/pci/intel/ipu3/cio2-bridge.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c
> index 59a36f922675..30d29b96a339 100644
> --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c
> +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c
> @@ -226,7 +226,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
> err_free_swnodes:
> software_node_unregister_nodes(sensor->swnodes);
> err_put_adev:
> - acpi_dev_put(sensor->adev);
> + acpi_dev_put(adev);
adev is assigned to sensor->adev before goto so the two have the same
value. I have no problem with the patch though.
> return ret;
> }
>
--
Regards,
Sakari Ailus
next prev parent reply other threads:[~2021-07-26 11:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 8:40 [PATCH v1 1/1] media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor() Andy Shevchenko
2021-07-26 11:44 ` Sakari Ailus [this message]
2021-07-26 11:55 ` Andy Shevchenko
2021-07-26 12:01 ` Sakari Ailus
2021-07-26 12:03 ` Andy Shevchenko
2021-07-26 12:03 ` Sakari Ailus
2021-07-27 11:35 ` Andy Shevchenko
2021-08-16 6:28 ` Sakari Ailus
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=20210726114433.GB3@paasikivi.fi.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=axboe@kernel.dk \
--cc=bingbu.cao@intel.com \
--cc=djrscally@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=tian.shu.qiu@intel.com \
--cc=yong.zhi@intel.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;
as well as URLs for NNTP newsgroup(s).