From: Johan Hovold <johan@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Wolfram Sang <wsa@kernel.org>,
syzbot+0591ccf54ee05344e4eb@syzkaller.appspotmail.com
Subject: Re: [PATCH v1 1/1] i2c: robotfuzz-osif: Propagate parent device to I2C core
Date: Mon, 21 Feb 2022 10:56:20 +0100 [thread overview]
Message-ID: <YhNhxPEt6kZ2xzMJ@hovoldconsulting.com> (raw)
In-Reply-To: <20220204151726.8924-1-andriy.shevchenko@linux.intel.com>
On Fri, Feb 04, 2022 at 05:17:26PM +0200, Andy Shevchenko wrote:
> I2C core might use parent device to retrieve properties of
> the controller. Propagate parent device for that.
What is the problem you're trying to solve here?
If you've changed some core function so that the kernel crashes because
of this, you need to address this in core.
Looks like you're also changing the device topology with this change.
This needs more details.
> Fixes: 83e53a8f120f ("i2c: Add bus driver for for OSIF USB i2c device.")
This isn't the commit causing the NULL deref.
> Reported-by: syzbot+0591ccf54ee05344e4eb@syzkaller.appspotmail.com
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/i2c/busses/i2c-robotfuzz-osif.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-robotfuzz-osif.c b/drivers/i2c/busses/i2c-robotfuzz-osif.c
> index 66dfa211e736..bfbfa0d07bb2 100644
> --- a/drivers/i2c/busses/i2c-robotfuzz-osif.c
> +++ b/drivers/i2c/busses/i2c-robotfuzz-osif.c
> @@ -128,6 +128,7 @@ MODULE_DEVICE_TABLE(usb, osif_table);
> static int osif_probe(struct usb_interface *interface,
> const struct usb_device_id *id)
> {
> + struct device *dev = &interface->dev;
> int ret;
> struct osif_priv *priv;
> u16 version;
> @@ -145,6 +146,7 @@ static int osif_probe(struct usb_interface *interface,
> priv->adapter.class = I2C_CLASS_HWMON;
> priv->adapter.algo = &osif_algorithm;
> priv->adapter.algo_data = priv;
> + priv->adapter.dev.parent = dev;
> snprintf(priv->adapter.name, sizeof(priv->adapter.name),
> "OSIF at bus %03d device %03d",
> priv->usb_dev->bus->busnum, priv->usb_dev->devnum);
Johan
next prev parent reply other threads:[~2022-02-21 10:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 15:17 Andy Shevchenko
2022-02-18 14:22 ` Wolfram Sang
2022-02-20 10:57 ` Andy Shevchenko
2022-02-21 9:56 ` Johan Hovold [this message]
2022-02-21 18:40 ` Andy Shevchenko
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=YhNhxPEt6kZ2xzMJ@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+0591ccf54ee05344e4eb@syzkaller.appspotmail.com \
--cc=wsa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®