Smatch complains that the NULL checking in this function is not
consistent and could lead to a NULL dereference. The comments say that
we should return here if rc_dev is NULL so I've changed the test to
match the comment.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
/* ignore if rc_dev is NULL or status is shunned */
spin_lock_irqsave(&data->lock, flags);
- if (data->rc_dev && (data->status & PICOLCD_CIR_SHUN)) {
+ if (!data->rc_dev || (data->status & PICOLCD_CIR_SHUN)) {
spin_unlock_irqrestore(&data->lock, flags);
return 1;
}