diff options
author | 2020-11-17 10:22:51 +0300 | |
---|---|---|
committer | 2020-11-24 12:43:40 +0100 | |
commit | d3d73d25e0d9bc43fd2a6f4b4e58ff182e55b217 (patch) | |
tree | 8f09dd2e1dc053d22300381cb3184f3ade01a489 /drivers/platform | |
parent | platform/x86: i2c-multi-instantiate: Use device_get_match_data() to get drive... (diff) | |
download | linux-d3d73d25e0d9bc43fd2a6f4b4e58ff182e55b217.tar.gz linux-d3d73d25e0d9bc43fd2a6f4b4e58ff182e55b217.tar.bz2 linux-d3d73d25e0d9bc43fd2a6f4b4e58ff182e55b217.zip |
platform/x86: pmt: Fix a potential Oops on error in probe
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>
Reviewed-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20201117072251.GC1111239@mwanda
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel_pmt_class.c | 3 |
1 files changed, 2 insertions, 1 deletions
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: |