From patchwork Tue Apr 16 06:02:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2447611 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5D6CFDF230 for ; Tue, 16 Apr 2013 06:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753954Ab3DPGOj (ORCPT ); Tue, 16 Apr 2013 02:14:39 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:57741 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753725Ab3DPGOj (ORCPT ); Tue, 16 Apr 2013 02:14:39 -0400 Received: by mail-pb0-f46.google.com with SMTP id rp8so110719pbb.5 for ; Mon, 15 Apr 2013 23:14:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=L6cCRZRWw1CyVg8hIRNJra4r7ovcq99tHgXqP7em4Yw=; b=V/5C/EB6VGOFExz9yus2/81hf7erNY+glg8FdwjhqhuWFyg9cW3ZrORrzdYOCtXe09 SC2dLy0PxYL43ydJr5QP3YwFpfoy5ru6FI8a845M44Re+c8yEpv1awpID7FfpnJcJ0rj LxzWtb6Lp67KCNH805j+nUW1VMzFRxDhud23rOsEP+PQ4tBV0m3HP81bO068ZY/ZOUn3 o4Kh58V4FtakbNQ5jFo7uSMQLBIICet5HDDU+EMphBbUd5NV/S/byL0NqwYSlzD3Qh7w OLKXzc6G0zeFf2XbTSv4WDlM6fOeZbqft7q7KOV3d0SEKQ8GA70kCX0G2Xr1CpiAR69R 5y5A== X-Received: by 10.66.222.228 with SMTP id qp4mr1716727pac.113.1366092878806; Mon, 15 Apr 2013 23:14:38 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id li15sm1333239pab.2.2013.04.15.23.14.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 23:14:37 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/5] [media] exynos4-is: Fix potential null pointer dereferencing Date: Tue, 16 Apr 2013 11:32:19 +0530 Message-Id: <1366092143-5482-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkBnIGGglc+BdE7KFZ/3Atb6qHLdp1rr1Tm2LdwWuud1F4cTA+7KtmUJp1BsBd1GRMDhp8H Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If fimc->drv_data is NULL, then fimc->drv_data->num_entities would cause NULL pointer dereferencing. Hence remove it from print statement. Signed-off-by: Sachin Kamat --- drivers/media/platform/exynos4-is/fimc-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index f25807d..a8eaad0 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -955,8 +955,8 @@ static int fimc_probe(struct platform_device *pdev) } if (!fimc->drv_data || fimc->id >= fimc->drv_data->num_entities || fimc->id < 0) { - dev_err(dev, "Invalid driver data or device id (%d/%d)\n", - fimc->id, fimc->drv_data->num_entities); + dev_err(dev, "Invalid driver data or device id (%d)\n", + fimc->id); return -EINVAL; } if (!dev->of_node)