From patchwork Fri Apr 26 08:52:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 18227 X-Patchwork-Delegate: sylvester.nawrocki@gmail.com Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UVebA-00054U-Ib; Fri, 26 Apr 2013 11:05:44 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-8) with esmtp id 1UVeb8-0005Q0-lU; Fri, 26 Apr 2013 11:05:44 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755892Ab3DZJFk (ORCPT + 1 other); Fri, 26 Apr 2013 05:05:40 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:59263 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755858Ab3DZJFi (ORCPT ); Fri, 26 Apr 2013 05:05:38 -0400 Received: by mail-pb0-f54.google.com with SMTP id jt11so1088239pbb.13 for ; Fri, 26 Apr 2013 02:05: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=Q+sai+kk1RHdzZQwIDSNUdelIzEhAC0FoJWyifvxFQ0=; b=P15PuL3MNR587qhLGpj/TU9eNehtI3lLu5t9zN6igKhGMshDph+JSf3XLO+SiKAohj CQ6ofjMAouFD4UiQXcYh73ziy7wFKs4r1bmfF5PT27BDfaidouZBV6SFAYvwnEPyuaP/ DolGd507iam4uxf9tzFPWUpBsX7EsK3HLOzdsEjhKx5L7JdQLx2iqjTV9EeWe/wG1klD LhK5Wh9FWuEyaWwpFZTPPbaEUEU5uRROgeGjHzzSDvwCKoZWrNpCgy2V69Rnf5CVCktt MiHTww4tqMGA+Wx/TcMps1QoX1/xQCX4h/2yPpLmBz6+S9y3ZBt+obsYumuuegO3uM86 HRiw== X-Received: by 10.68.94.227 with SMTP id df3mr56869758pbb.182.1366967138323; Fri, 26 Apr 2013 02:05:38 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id qi1sm11898513pac.21.2013.04.26.02.05.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 02:05: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 v2] [media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c Date: Fri, 26 Apr 2013 14:22:57 +0530 Message-Id: <1366966377-15808-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQk70cqy0BCx3Caz6vqqYSR7aeBLR99RYxGCmwOzWSrSO5Mw8AcYT6ir3+YLhEtr7w7b/iK3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.4.26.85117 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1100_1199 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' When 'node' is NULL, the print statement tries to dereference it. Hence replace the variable with the one that is accessible. Signed-off-by: Sachin Kamat --- Changes since v1: Used pdev->dev.of_node->full_name for node name. --- drivers/media/platform/exynos4-is/mipi-csis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index a2eda9d..254d70f 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -746,7 +746,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev, node = v4l2_of_get_next_endpoint(node, NULL); if (!node) { dev_err(&pdev->dev, "No port node at %s\n", - node->full_name); + pdev->dev.of_node->full_name); return -EINVAL; } /* Get port node and validate MIPI-CSI channel id. */