]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: most: dim2: remove unnecessary NULL check in try_start_dim_transfer()
authorGabriel Rondon <grondon@gmail.com>
Wed, 1 Apr 2026 10:10:38 +0000 (11:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 11:01:51 +0000 (05:01 -0600)
Remove the !hdm_ch check. Although hdm_ch is a function parameter,
it is already dereferenced on the preceding line to initialize
head (head = &hdm_ch->pending_list), so a NULL check after that
point is dead code.

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

index f5bd7d44f1656a78ddd03b0cff7675ccb0f7d7f2..327790436653311758927e7ea656cb00667b7278 100644 (file)
@@ -165,7 +165,7 @@ static int try_start_dim_transfer(struct hdm_channel *hdm_ch)
        unsigned long flags;
        struct dim_ch_state st;
 
-       if (!hdm_ch || !hdm_ch->is_initialized)
+       if (!hdm_ch->is_initialized)
                return -EINVAL;
 
        spin_lock_irqsave(&dim_lock, flags);