From patchwork Mon Jan 31 12:49:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 5766 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 31 Jan 2011 10:49:38 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PjtCM-0006OI-1Q for mchehab@pedra; Mon, 31 Jan 2011 10:49:38 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 31 Jan 2011 10:49:38 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PjtBe-0005na-Fk; Mon, 31 Jan 2011 12:48:54 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755300Ab1AaMsw (ORCPT + 1 other); Mon, 31 Jan 2011 07:48:52 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:59027 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755164Ab1AaMsw (ORCPT ); Mon, 31 Jan 2011 07:48:52 -0500 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 43DE8188B5BB; Mon, 31 Jan 2011 13:48:50 +0100 (CET) X-Auth-Info: /ne0WY+rse2qEiwv8ek8PM/zRAPRNCP7J5llRfITQAk= Received: from localhost (p4FE3DF32.dip.t-dialin.net [79.227.223.50]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 78CCB1C000A0; Mon, 31 Jan 2011 13:48:50 +0100 (CET) From: Anatolij Gustschin To: linux-media@vger.kernel.org Cc: Guennadi Liakhovetski , Markus Niebel Subject: [PATCH] v4l: mx3_camera: fix NULL pointer dereference if debug output enabled Date: Mon, 31 Jan 2011 13:49:41 +0100 Message-Id: <1296478181-10838-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Running with enabled debug output in the mx3_camera driver results in a kernel crash: ... mx3-camera mx3-camera.0: Providing format Bayer BGGR (sRGB) 8 bit using code 11 Unable to handle kernel NULL pointer dereference at virtual address 00000004 ... Fix it by incrementing 'xlate' after usage. Signed-off-by: Anatolij Gustschin --- drivers/media/video/mx3_camera.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index b9cb4a4..7bcaaf7 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c @@ -734,9 +734,9 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id if (xlate) { xlate->host_fmt = fmt; xlate->code = code; - xlate++; dev_dbg(dev, "Providing format %x in pass-through mode\n", xlate->host_fmt->fourcc); + xlate++; } return formats;