From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbcBBH2B (ORCPT ); Tue, 2 Feb 2016 02:28:01 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33938 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752354AbcBBH2A (ORCPT ); Tue, 2 Feb 2016 02:28:00 -0500 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] component: remove impossible condition Date: Tue, 2 Feb 2016 12:57:53 +0530 Message-Id: <1454398073-5161-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/base/component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index 2738039..0ed3b72 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -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); -- 1.9.1