From patchwork Wed Jul 27 07:58:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1010922 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6R7wq7d030246 for ; Wed, 27 Jul 2011 07:58:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784Ab1G0H6c (ORCPT ); Wed, 27 Jul 2011 03:58:32 -0400 Received: from mga03.intel.com ([143.182.124.21]:60582 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826Ab1G0H6c (ORCPT ); Wed, 27 Jul 2011 03:58:32 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 27 Jul 2011 00:58:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,275,1309762800"; d="scan'208";a="31953067" Received: from unknown (HELO smile) ([10.255.17.225]) by azsmga001.ch.intel.com with ESMTP; 27 Jul 2011 00:58:29 -0700 Received: from andy by smile with local (Exim 4.76) (envelope-from ) id 1Qlz0S-0004pE-3F; Wed, 27 Jul 2011 10:58:16 +0300 From: Andy Shevchenko To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Mauro Carvalho Chehab , Sakari Ailus Subject: [PATCH] adp1653: check error code of adp1653_init_controls Date: Wed, 27 Jul 2011 10:58:02 +0300 Message-Id: <1b238cd98e03909bc4955113ffbe7e0c9f0db4f8.1311753459.git.andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.7.5.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Jul 2011 07:58:52 +0000 (UTC) Potentially the adp1653_init_controls could return an error. In our case the error was ignored, meanwhile it means incorrect initialization of V4L2 controls. Signed-off-by: Andy Shevchenko Cc: Mauro Carvalho Chehab Cc: Sakari Ailus --- drivers/media/video/adp1653.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c index 8ad89ff..3379e6d 100644 --- a/drivers/media/video/adp1653.c +++ b/drivers/media/video/adp1653.c @@ -429,7 +429,11 @@ static int adp1653_probe(struct i2c_client *client, flash->subdev.internal_ops = &adp1653_internal_ops; flash->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; - adp1653_init_controls(flash); + ret = adp1653_init_controls(flash); + if (ret) { + kfree(flash); + return ret; + } ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0); if (ret < 0)