From patchwork Tue Jan 4 11:42:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzianis Kahanovich X-Patchwork-Id: 450541 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p04BgLra011253 for ; Tue, 4 Jan 2011 11:42:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751235Ab1ADLmV (ORCPT ); Tue, 4 Jan 2011 06:42:21 -0500 Received: from mail.bspu.unibel.by ([195.50.2.21]:36748 "EHLO mail.bspu.local" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750917Ab1ADLmV (ORCPT ); Tue, 4 Jan 2011 06:42:21 -0500 Received: from [10.200.200.1] ([10.200.200.1]) by mail.bspu.local (8.14.4/8.14.4) with ESMTP id p04Bg1Xd018500; Tue, 4 Jan 2011 13:42:06 +0200 Message-ID: <4D23078E.8070801@bspu.unibel.by> Date: Tue, 04 Jan 2011 13:42:06 +0200 From: Dzianis Kahanovich Reply-To: mahatma@eu.by User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b7pre) Gecko/20101123 Firefox/4.0b7pre SeaMonkey/2.1b1 MIME-Version: 1.0 To: Florian Tobias Schandinat CC: Paul Mundt , Joseph Chan , linux-fbdev@vger.kernel.org Subject: [PATCH] via-camera: check viafb_find_i2c_adapter() result to NULL References: <4CED3DD5.5080405@bspu.unibel.by> <20101130061357.GE17114@linux-sh.org> <4CF8DA25.4020204@bspu.unibel.by> <4CF9879A.3090409@gmx.de> <4D00D508.1060106@bspu.unibel.by> <4D03E177.6060305@gmx.de> In-Reply-To: <4D03E177.6060305@gmx.de> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.bspu.local Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 04 Jan 2011 11:42:23 +0000 (UTC) --- b/drivers/media/video/via-camera.c 2011-01-04 13:08:18.000000000 +0200 +++ c/drivers/media/video/via-camera.c 2011-01-04 13:35:45.000000000 +0200 @@ -1344,8 +1344,9 @@ static __devinit int viacam_probe(struct * is OLPC-specific. 0x42 assumption is ov7670-specific. */ sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31); - cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, sensor_adapter, - "ov7670", 0x42 >> 1, NULL); + if (sensor_adapter != NULL) + cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, + sensor_adapter, "ov7670", 0x42 >> 1, NULL); if (cam->sensor == NULL) { dev_err(&pdev->dev, "Unable to find the sensor!\n"); ret = -ENODEV;