V4L/DVB (13825): ir-core: Don't OOPS if IR device props is not defined
authorMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 17 Dec 2009 02:46:48 +0000 (23:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:24 +0000 (15:10 -0300)
As currently most drivers don't define ir_dev->props, we shouldn't assume
that this field is defined.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-sysfs.c

index d67c11d9921f62dcaddc4a5dc31af93af65316aa..6ec7f89d51421b846ba3d790bbec2ea52eb23ba6 100644 (file)
@@ -97,7 +97,7 @@ static ssize_t store_protocol(struct device *d,
                return -EINVAL;
        }
 
-       if (ir_dev->props->change_protocol)
+       if (ir_dev->props && ir_dev->props->change_protocol)
                rc = ir_dev->props->change_protocol(ir_dev->props->priv,
                                                    ir_type);