Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751171AbdHZUwJ (ORCPT ); Sat, 26 Aug 2017 16:52:09 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33892 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdHZUwH (ORCPT ); Sat, 26 Aug 2017 16:52:07 -0400 From: Himanshu Jha To: mchehab@kernel.org Cc: gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] [media] atomisp2: Remove null check before kfree Date: Sun, 27 Aug 2017 02:21:49 +0530 Message-Id: <1503780709-8938-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 889 Lines: 26 Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- .../staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c index 6358216..451c76e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c @@ -295,10 +295,8 @@ void sh_css_unload_firmware(void) } memset(&sh_css_sp_fw, 0, sizeof(sh_css_sp_fw)); - if (sh_css_blob_info) { - kfree(sh_css_blob_info); - sh_css_blob_info = NULL; - } + kfree(sh_css_blob_info); + sh_css_blob_info = NULL; sh_css_num_binaries = 0; } -- 2.7.4