From patchwork Fri Aug 2 06:32:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 18733 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f197.google.com (mail-gh0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C13F238F6 for ; Fri, 2 Aug 2013 06:48:58 +0000 (UTC) Received: by mail-gh0-f197.google.com with SMTP id r20sf338175ghr.0 for ; Thu, 01 Aug 2013 23:48:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-removed-original-auth :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=XApFO5m4P0ZoAx5RQDSHsk6O5U5Aj9oa4INyUAjeJNs=; b=prUXjyUxKNnUkacFMnsWyCK/mZTTmsH6rru1NDB1qippgpxXxxtcg8bKWumyeMfVW7 4d5HlAbSSnVURs1ob2R3QlUaYNwOu3r87HHovzhC+DHlXKqMZes7hH6Qfa/4lTsJuNfY u/mEssM0NFpfkpJGotZ97173QsgH6YZoUYHUOqT9EH2yikznism7+OIKIrP6E8nHEVs1 6NpMQGAIn7BZxJi2QANu8DZ6QMQurAaH3Z9Kd8GbxF5VDL4xYThpnAaOtfWSJGKrcFCg COMUrfb84hIg4p0k2MH7ULmjqPMt10vByq6TE59EqdYI6NarzPtQQQIEuW82+ex79Vvl BjbQ== X-Received: by 10.236.15.73 with SMTP id e49mr2217772yhe.15.1375426138289; Thu, 01 Aug 2013 23:48:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.40 with SMTP id c8ls1501932qel.72.gmail; Thu, 01 Aug 2013 23:48:58 -0700 (PDT) X-Received: by 10.52.73.229 with SMTP id o5mr1306584vdv.54.1375426138192; Thu, 01 Aug 2013 23:48:58 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id mu5si1537076vec.141.2013.08.01.23.48.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 23:48:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id cy12so271006veb.4 for ; Thu, 01 Aug 2013 23:48:58 -0700 (PDT) X-Received: by 10.52.109.69 with SMTP id hq5mr1325036vdb.85.1375426138076; Thu, 01 Aug 2013 23:48:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp340526vcb; Thu, 1 Aug 2013 23:48:57 -0700 (PDT) X-Received: by 10.68.201.226 with SMTP id kd2mr6050947pbc.45.1375426137296; Thu, 01 Aug 2013 23:48:57 -0700 (PDT) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by mx.google.com with ESMTPS id co1si5532762pbc.138.2013.08.01.23.48.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 23:48:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.180 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.192.180; Received: by mail-pd0-f180.google.com with SMTP id 15so318494pdi.39 for ; Thu, 01 Aug 2013 23:48:57 -0700 (PDT) X-Received: by 10.66.163.229 with SMTP id yl5mr8798594pab.69.1375426136929; Thu, 01 Aug 2013 23:48:56 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id 7sm5068399paf.22.2013.08.01.23.48.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 23:48:56 -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 3/3] [media] exynos4-is: Fix potential NULL pointer dereference Date: Fri, 2 Aug 2013 12:02:14 +0530 Message-Id: <1375425134-17080-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1375425134-17080-1-git-send-email-sachin.kamat@linaro.org> References: <1375425134-17080-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQnYibz4OIKXWfaVO8JRS/b7H2NFN6oPLYltltsRZa1MpatKoo8Mm7fkMlDD9uSpviDivi1z X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , dev->of_node could be NULL. Hence check for the same and return before dereferencing it in the subsequent error message. Signed-off-by: Sachin Kamat --- drivers/media/platform/exynos4-is/fimc-lite.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index 08fbfed..214bde2 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c @@ -1513,6 +1513,9 @@ static int fimc_lite_probe(struct platform_device *pdev) if (of_id) drv_data = (struct flite_drvdata *)of_id->data; fimc->index = of_alias_get_id(dev->of_node, "fimc-lite"); + } else { + dev_err(dev, "device node not found\n"); + return -EINVAL; } if (!drv_data || fimc->index >= drv_data->num_instances ||