* [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
@ 2020-11-17 7:22 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-11-17 7:22 UTC (permalink / raw)
To: David E. Box, Alexander Duyck
Cc: Hans de Goede, Mark Gross, Lee Jones, platform-driver-x86,
kernel-janitors
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:
--
2.28.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
@ 2020-11-17 7:22 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-11-17 7:22 UTC (permalink / raw)
To: David E. Box, Alexander Duyck
Cc: Hans de Goede, Mark Gross, Lee Jones, platform-driver-x86,
kernel-janitors
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:
--
2.28.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
2020-11-17 7:22 ` Dan Carpenter
@ 2020-11-17 18:29 ` David E. Box
-1 siblings, 0 replies; 6+ messages in thread
From: David E. Box @ 2020-11-17 18:29 UTC (permalink / raw)
To: Dan Carpenter
Cc: Hans de Goede, Mark Gross, Lee Jones, platform-driver-x86,
kernel-janitors
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:
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
@ 2020-11-17 18:29 ` David E. Box
0 siblings, 0 replies; 6+ messages in thread
From: David E. Box @ 2020-11-17 18:29 UTC (permalink / raw)
To: Dan Carpenter
Cc: Hans de Goede, Mark Gross, Lee Jones, platform-driver-x86,
kernel-janitors
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:
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
2020-11-17 7:22 ` Dan Carpenter
@ 2020-11-24 11:44 ` Hans de Goede
-1 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-11-24 11:44 UTC (permalink / raw)
To: Dan Carpenter, David E. Box, Alexander Duyck
Cc: Mark Gross, Lee Jones, platform-driver-x86, kernel-janitors
Hi,
On 11/17/20 8:22 AM, 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>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> 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:
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe
@ 2020-11-24 11:44 ` Hans de Goede
0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-11-24 11:44 UTC (permalink / raw)
To: Dan Carpenter, David E. Box, Alexander Duyck
Cc: Mark Gross, Lee Jones, platform-driver-x86, kernel-janitors
Hi,
On 11/17/20 8:22 AM, 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>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> 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:
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-11-24 11:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-17 7:22 [PATCH] platform/x86: pmt: Fix a potential Oops on error in probe Dan Carpenter
2020-11-17 7:22 ` Dan Carpenter
2020-11-17 18:29 ` David E. Box
2020-11-17 18:29 ` David E. Box
2020-11-24 11:44 ` Hans de Goede
2020-11-24 11:44 ` Hans de Goede
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.