X86 platform drivers
 help / color / mirror / Atom feed
From: "David E. Box" <david.e.box@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
Date: Tue, 17 Nov 2020 10:29:51 -0800	[thread overview]
Message-ID: <ed41e77dd19971faf01b3062c5e25e7ed8ed69db.camel@linux.intel.com> (raw)
In-Reply-To: <20201117072251.GC1111239@mwanda>

Thanks Dan.

Reviewed-by: David E. Box <david.e.box@linux.intel.com>

On Tue, 2020-11-17 at 10:22 +0300, Dan Carpenter wrote:
> The "ns->attr_grp" pointer can be NULL so this error handling code
> needs
> to check for that to avoid an Oops.
> 
> Fixes: e2729113ce66 ("platform/x86: Intel PMT class driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/platform/x86/intel_pmt_class.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel_pmt_class.c
> b/drivers/platform/x86/intel_pmt_class.c
> index aa88dc23bbde..c8939fba4509 100644
> --- a/drivers/platform/x86/intel_pmt_class.c
> +++ b/drivers/platform/x86/intel_pmt_class.c
> @@ -225,7 +225,8 @@ static int intel_pmt_dev_register(struct
> intel_pmt_entry *entry,
>  		return 0;
>  
>  fail_ioremap:
> -	sysfs_remove_group(entry->kobj, ns->attr_grp);
> +	if (ns->attr_grp)
> +		sysfs_remove_group(entry->kobj, ns->attr_grp);
>  fail_sysfs:
>  	device_unregister(dev);
>  fail_dev_create:


  reply	other threads:[~2020-11-17 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17  7:22 [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe Dan Carpenter
2020-11-17 18:29 ` David E. Box [this message]
2020-11-24 11:44 ` Hans de Goede

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=ed41e77dd19971faf01b3062c5e25e7ed8ed69db.camel@linux.intel.com \
    --to=david.e.box@linux.intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox