platform/x86: pmt: Fix a potential Oops on error in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 17 Nov 2020 07:22:51 +0000 (10:22 +0300)
committerHans de Goede <hdegoede@redhat.com>
Tue, 24 Nov 2020 11:43:40 +0000 (12:43 +0100)
commitd3d73d25e0d9bc43fd2a6f4b4e58ff182e55b217
tree8f09dd2e1dc053d22300381cb3184f3ade01a489
parent469bc41c29e616cadd641ac39070bde9b63acfdf
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>
drivers/platform/x86/intel_pmt_class.c