From patchwork Thu Nov 26 13:00:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Huerst X-Patchwork-Id: 7706641 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1523BBF90C for ; Thu, 26 Nov 2015 13:01:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C336206F7 for ; Thu, 26 Nov 2015 13:01:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2E6C3206CD for ; Thu, 26 Nov 2015 13:01:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 26804264ED4; Thu, 26 Nov 2015 14:01:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B8D62261A0A; Thu, 26 Nov 2015 14:01:00 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 40A19261A5E; Thu, 26 Nov 2015 14:00:59 +0100 (CET) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by alsa0.perex.cz (Postfix) with ESMTP id 0F5A12619FB for ; Thu, 26 Nov 2015 14:00:52 +0100 (CET) Received: by wmvv187 with SMTP id v187so30479014wmv.1 for ; Thu, 26 Nov 2015 05:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5e1lWtyAsuseiVSjq16frAd3E3AW6X6XnOEPr2fOqzA=; b=IVMq/Kp6da0ppHMBXQbDqnNMO8OeAgMYXO+qPuUqn959cLxlkoH9nZrSzdKOrFzijq hZPwq4eRzT6TM0k6I0C73cSp2nu4uIHjcxfZ5wK0KV6YR10CSASNTJdevCRofvRNj4IN InrDpJp7u66GGeZFhgbVMan6NA/gf6DKMe0R6rkxGZgiNq0+EGyGn7VL8Reu3kpUoi/R 4NGiDUkk6Rm+G4LKMTIxZGJ98+h9+gU3BeqI47RoTlvGByWDxdyEKKGMlYnejBCI44Zk PGWGs8Y8STiw3YFWj21UY6a0aIPAb8f34j47cSMOgwwC9oQY4MinA+a+NYCpjW9XC8qE vklA== X-Received: by 10.195.11.101 with SMTP id eh5mr49783626wjd.104.1448542851750; Thu, 26 Nov 2015 05:00:51 -0800 (PST) Received: from localhost.localdomain.localdomain ([212.91.253.218]) by smtp.gmail.com with ESMTPSA id h67sm2608527wmf.17.2015.11.26.05.00.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2015 05:00:51 -0800 (PST) From: pascal.huerst@gmail.com To: lars@metafoo.de Date: Thu, 26 Nov 2015 14:00:15 +0100 Message-Id: <1448542815-14197-1-git-send-email-pascal.huerst@gmail.com> X-Mailer: git-send-email 2.4.3 Cc: alsa-devel@alsa-project.org, Pascal Huerst Subject: [alsa-devel] [PATCH] ASoC: sigmadsp: Add check for return value of i2c_master_send X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Pascal Huerst i2c_master_send returns the number of bytes transmitted, which leads to an error in the firmware download function. Check for the return value and only return it directly, if it is an actual error number. Signed-off-by: Pascal Huerst Acked-by: Lars-Peter Clausen --- sound/soc/codecs/sigmadsp-i2c.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.4.3 diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c index 21ca3a5..d374c18 100644 --- a/sound/soc/codecs/sigmadsp-i2c.c +++ b/sound/soc/codecs/sigmadsp-i2c.c @@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data, kfree(buf); - return ret; + if (ret < 0) + return ret; + + return 0; } static int sigmadsp_read_i2c(void *control_data,