summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-28 12:11:57 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-11 18:24:23 +0200
commitd9ab83953fa700cc7be319cea1ec747601a124a1 (patch)
tree2c16e3d7bd6259a757a33e9b8b5b34efdfba9d32 /drivers/staging/media/atomisp/pci
parenta86b4936ba6827e7c1b658d522412e5a78c03242 (diff)
downloadlinux-d9ab83953fa700cc7be319cea1ec747601a124a1.tar.bz2
media: atomisp: don't cause a warn if probe failed
When probe fails, it is possible that hmm_init() to not be called. On such case, hmm_cleanup() will cause a WARN_ON(). Avoid it by adding an explicit check at hmm_cleanup() to ensure that the hmm code was properly initialized. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci')
-rw-r--r--drivers/staging/media/atomisp/pci/hmm/hmm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c
index f9c2c7896520..c2abd14353e6 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c
@@ -208,6 +208,8 @@ int hmm_init(void)
void hmm_cleanup(void)
{
+ if (!dummy_ptr)
+ return;
sysfs_remove_group(&atomisp_dev->kobj, atomisp_attribute_group);
/* free dummy memory first */