]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: most: dim2: remove unnecessary NULL check in service_done_flag()
authorGabriel Rondon <grondon@gmail.com>
Tue, 31 Mar 2026 16:44:42 +0000 (17:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 11:01:51 +0000 (05:01 -0600)
Remove the !hdm_ch check. hdm_ch is derived from dev->hch + ch_idx
(pointer arithmetic on a struct member), so it can never be NULL.
Keep only the !hdm_ch->is_initialized check.

Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/all/acuoL4DRi0pmsQY1@stanley.mountain
Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260331164443.47682-1-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/dim2/dim2.c

index 7953d4626752fbcce0c50b9bdf82f7bfabb70110..f5bd7d44f1656a78ddd03b0cff7675ccb0f7d7f2 100644 (file)
@@ -271,7 +271,7 @@ static void service_done_flag(struct dim2_hdm *dev, int ch_idx)
        unsigned long flags;
        u8 *data;
 
-       if (!hdm_ch || !hdm_ch->is_initialized)
+       if (!hdm_ch->is_initialized)
                return;
 
        spin_lock_irqsave(&dim_lock, flags);