Skip to contentSkip to conversation

component: remove impossible condition

PATCH New Sudip Mukherjee 1 participant 1 message Feb 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 component: remove impossible condition

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.

---
 drivers/base/component.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/component.c +1 -1
index 2738039..0ed3b72 100644
@@ -267,7 +267,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);
Signature · 1 line
1.9.1