From patchwork Wed Sep 11 14:07:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2872881 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 53075BF43F for ; Wed, 11 Sep 2013 14:08:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEC9B201FD for ; Wed, 11 Sep 2013 14:08:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40E1420136 for ; Wed, 11 Sep 2013 14:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753991Ab3IKOIA (ORCPT ); Wed, 11 Sep 2013 10:08:00 -0400 Received: from mail-bk0-f48.google.com ([209.85.214.48]:35877 "EHLO mail-bk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752763Ab3IKOIA (ORCPT ); Wed, 11 Sep 2013 10:08:00 -0400 Received: by mail-bk0-f48.google.com with SMTP id my13so3527235bkb.7 for ; Wed, 11 Sep 2013 07:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=hZU7rk/W8ZdxPhmm93mpT1vDeA8c6RYaZQG3Pe9WbDQ=; b=nJeMeI7Rp8oxUzWgxws5R2dxfsOtMgibb61lgmESMTNk2kkQPwAjsdYy7loZTdI+ey O89rQgE/SR1mkWVcIcXLlEDEY6mWXEwNjxJqQJ52INAKg0ql64GH+noerTiDfxclK/sI /Z/2fs/k7UPxdC+jYiAtyvLNeRk4ENyqZUqpIhTejnamolKFKtCZ8f36oRJRW8AgmLMA cGvUjZU0ZTJzedX4vLdTKO4lwjk4zBXogLBfDFLPDPlBFjydu7N4gxvkdJuOS14o22y0 lp8XdX4IpxWWm/fZFsyIFASRH8t2zKR1E54jS8PJEllCoxF8ABNER3DYh+KLzcCKsCV7 jmcg== MIME-Version: 1.0 X-Received: by 10.205.10.132 with SMTP id pa4mr1678337bkb.15.1378908478787; Wed, 11 Sep 2013 07:07:58 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Wed, 11 Sep 2013 07:07:58 -0700 (PDT) Date: Wed, 11 Sep 2013 22:07:58 +0800 Message-ID: Subject: [PATCH] [media] adv7511: fix error return code in adv7511_probe() From: Wei Yongjun To: hans.verkuil@cisco.com, m.chehab@samsung.com Cc: yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix to return -ENOMEM in the new i2c client and create workqueue error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/media/i2c/adv7511.c | 2 ++ 1 file changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index 7a576097..665b0c9 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c @@ -1126,6 +1126,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * state->i2c_edid = i2c_new_dummy(client->adapter, state->i2c_edid_addr >> 1); if (state->i2c_edid == NULL) { v4l2_err(sd, "failed to register edid i2c client\n"); + err = -ENOMEM; goto err_entity; } @@ -1133,6 +1134,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * state->work_queue = create_singlethread_workqueue(sd->name); if (state->work_queue == NULL) { v4l2_err(sd, "could not create workqueue\n"); + err = -ENOMEM; goto err_unreg_cec; }