From patchwork Sat Sep 22 07:39:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11641 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 57A7623EB4 for ; Sat, 22 Sep 2012 07:42:57 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id E7821A18673 for ; Sat, 22 Sep 2012 07:42:56 +0000 (UTC) Received: by ieje10 with SMTP id e10so6583035iej.11 for ; Sat, 22 Sep 2012 00:42:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=pcBxa6lXYJ/WsGiiKB6p3vlBKDr5UPHmT5mpWiOFLWA=; b=EWMMYwX/DxgumXi1ogIGa7e0EPh1WnGl+R9edLB0k3wpuH2nMhAKsdRWf4KYMNr6jb +/LloXxtiMWu6uHbNs3TG4e7QAUhlZhDaEzDFMFQmqpONQKarkBOp82I+p+DES+udFki 2X4rv2rnvDoKaT8gi3cX6OaQQtI2RGncO+GrifSTGY6LG/ChRpnvoWerJ4T1MzgApAfE gf0O5YKqe7wEG7aBqdDf0mFVRWPsIFHKYoM5XbwEptck/fPkRCeMGB5Wm9iY3Cd5HdDI KgDzQ4t48S/W/nx/CJe60mEyRJEe8/TtzERXPJh5fwzm592vLV1bW2nUARmmogwCHIKI /nrA== Received: by 10.50.195.134 with SMTP id ie6mr574669igc.28.1348299776233; Sat, 22 Sep 2012 00:42:56 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp164962igc; Sat, 22 Sep 2012 00:42:55 -0700 (PDT) Received: by 10.68.242.10 with SMTP id wm10mr21376954pbc.61.1348299775622; Sat, 22 Sep 2012 00:42:55 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id px5si13850786pbb.202.2012.09.22.00.42.55 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Sep 2012 00:42:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by pbcmd12 with SMTP id md12so9722929pbc.37 for ; Sat, 22 Sep 2012 00:42:55 -0700 (PDT) Received: by 10.66.85.167 with SMTP id i7mr18686982paz.8.1348299775366; Sat, 22 Sep 2012 00:42:55 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id gv1sm6330264pbc.38.2012.09.22.00.42.52 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Sep 2012 00:42:54 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: t.stanislaws@samsung.com, s.nawrocki@samsung.com, mchehab@infradead.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH] [media] s5p-tv: Fix potential NULL pointer dereference error Date: Sat, 22 Sep 2012 13:09:19 +0530 Message-Id: <1348299559-20952-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmGLvzGT5fqfLvgyX1iQz5d9GcQn0ACsoH9zH6BnZBTFggKR6U1cxY4R4NiqT7JQWSMYOZw When mdev is NULL, the error print statement will try to dereference the NULL pointer. Signed-off-by: Sachin Kamat Acked-by: Tomasz Stanislawski --- drivers/media/platform/s5p-tv/mixer_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c b/drivers/media/platform/s5p-tv/mixer_drv.c index a15ca05..ca0f297 100644 --- a/drivers/media/platform/s5p-tv/mixer_drv.c +++ b/drivers/media/platform/s5p-tv/mixer_drv.c @@ -384,7 +384,7 @@ static int __devinit mxr_probe(struct platform_device *pdev) mdev = kzalloc(sizeof *mdev, GFP_KERNEL); if (!mdev) { - mxr_err(mdev, "not enough memory.\n"); + dev_err(dev, "not enough memory.\n"); ret = -ENOMEM; goto fail; }