Linux Input/HID development
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Zhang, Lixu" <lixu.zhang@intel.com>,
	linux-input@vger.kernel.org,  jikos@kernel.org,
	benjamin.tissoires@redhat.com
Subject: Re: [PATCH] HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc
Date: Tue, 05 Mar 2024 16:53:55 -0800	[thread overview]
Message-ID: <f5ca7644241a989779d85086ac55e8c100d926a2.camel@linux.intel.com> (raw)
In-Reply-To: <20240306004404.2770417-1-lixu.zhang@intel.com>

On Wed, 2024-03-06 at 00:44 +0000, Zhang, Lixu wrote:
> From: Zhang Lixu <lixu.zhang@intel.com>
> 
> The variable dev->devc in ish_dev_init was utilized by dev_err before
> it
> was properly assigned. To rectify this, the assignment of dev->devc
> has
> been moved to immediately follow memory allocation.
> 
> Without this change "(NULL device *)" is printed for device
> information.
> 
> Fixes: 8ae2f2b0a284 ("HID: intel-ish-hid: ipc: Fix potential use-
> after-free in work function")
> Fixes: ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")
> Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
This is not an important change to submit to rc cycle.
This is just a logging issue.

Thanks,
Srinivas

>  drivers/hid/intel-ish-hid/ipc/ipc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-
> ish-hid/ipc/ipc.c
> index 7cc412798fdf..adce30f8ebff 100644
> --- a/drivers/hid/intel-ish-hid/ipc/ipc.c
> +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
> @@ -948,6 +948,7 @@ struct ishtp_device *ish_dev_init(struct pci_dev
> *pdev)
>         if (!dev)
>                 return NULL;
>  
> +       dev->devc = &pdev->dev;
>         ishtp_device_init(dev);
>  
>         init_waitqueue_head(&dev->wait_hw_ready);
> @@ -983,7 +984,6 @@ struct ishtp_device *ish_dev_init(struct pci_dev
> *pdev)
>         }
>  
>         dev->ops = &ish_hw_ops;
> -       dev->devc = &pdev->dev;
>         dev->mtu = IPC_PAYLOAD_SIZE - sizeof(struct ishtp_msg_hdr);
>         return dev;
>  }


  reply	other threads:[~2024-03-06  0:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  0:44 [PATCH] HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc Zhang, Lixu
2024-03-06  0:53 ` srinivas pandruvada [this message]
2024-03-21 12:44   ` Jiri Kosina

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=f5ca7644241a989779d85086ac55e8c100d926a2.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=lixu.zhang@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