component: remove impossible condition
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Tue, 2 Feb 2016 07:27:53 +0000 (12:57 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2016 01:39:33 +0000 (17:39 -0800)
We will be evaluating this condition only if match->num == match->alloc
and that means we have already dereferenced match which implies match
can not be NULL at this point.
Moreover we have done a NULL check on match just before this.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/component.c

index 89f5cf68d80a143198c2c253d6d21c0d9fb38388..2085b234f7c8b83b4f15413c6cb13528f672f235 100644 (file)
@@ -265,7 +265,7 @@ void component_match_add_release(struct device *master,
        }
 
        if (match->num == match->alloc) {
-               size_t new_size = match ? match->alloc + 16 : 15;
+               size_t new_size = match->alloc + 16;
                int ret;
 
                ret = component_match_realloc(master, match, new_size);