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: 1494251 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E612E3FD40 for ; Sat, 22 Sep 2012 07:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754309Ab2IVHm4 (ORCPT ); Sat, 22 Sep 2012 03:42:56 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:45794 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754258Ab2IVHmz (ORCPT ); Sat, 22 Sep 2012 03:42:55 -0400 Received: by pbbrr4 with SMTP id rr4so4115481pbb.19 for ; Sat, 22 Sep 2012 00:42:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=pcBxa6lXYJ/WsGiiKB6p3vlBKDr5UPHmT5mpWiOFLWA=; b=JJVasst859Zh4SlOyD5Lbn6ufdR/z7VyAh+YoaQGr27Obp1AgnSWXRQwoMu8GJWHZm +fCO4SIWXacxszOa1MxgR7CnNSgR9ACt/XMydFiEWPEAKVRWS4zMDjrdbUbyoNbSO5dF XYrWw4X5FlPXYyFSjK2RteJWPsODkoG/UPc2EPlteioZ1cCHNUf8QlcCIrwFCxXVGIas IvjobN4g4wYatNdntRIMPeB7uPl0Gq7EDLz763aalNhM0KZEjybnf2tm884dc3be2keL /hdVyQ0j6e/ZHCF8ngNkDMuPC6Xfq1Wj2xqx4U63syxmhCof2eGHY6K4SBVVuf/KaMhV IKRQ== 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: ALoCoQnYg9URHfR4iJe/4sI8aKdgNdVo8REgpjoDfWfxmjSG/DKsN3aimj3dG5Lv/mdd6s0ySqUy Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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; }