Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751655AbdH3Nbd (ORCPT ); Wed, 30 Aug 2017 09:31:33 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34545 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbdH3Nbc (ORCPT ); Wed, 30 Aug 2017 09:31:32 -0400 X-Google-Smtp-Source: ADKCNb4VnY3eHq+rvzHzZKWKfc5GXexuKymbwwreBYmwKnUOW421QoPuJolAOzWgkPy93MILA6/Xng== From: Himanshu Jha To: jani.nikula@linux.intel.com Cc: joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] drm/i915/opregion: Remove null check before kfree Date: Wed, 30 Aug 2017 19:01:16 +0530 Message-Id: <1504099876-4142-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: 846 Lines: 26 kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- drivers/gpu/drm/i915/intel_opregion.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index 98154ef..2427b40 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c @@ -830,10 +830,8 @@ void intel_opregion_unregister(struct drm_i915_private *dev_priv) memunmap(opregion->rvda); opregion->rvda = NULL; } - if (opregion->vbt_firmware) { - kfree(opregion->vbt_firmware); - opregion->vbt_firmware = NULL; - } + kfree(opregion->vbt_firmware); + opregion->vbt_firmware = NULL; opregion->header = NULL; opregion->acpi = NULL; opregion->swsci = NULL; -- 2.7.4