Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2330099imm; Fri, 7 Sep 2018 14:47:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZKgfetqrkraHXBgERcypsovUGDlIVaVZxVPpYg+wzYL8YtkvGuIxxY+AQ3ZICfYag3K9qO X-Received: by 2002:a17:902:6b4b:: with SMTP id g11-v6mr7895401plt.19.1536356842770; Fri, 07 Sep 2018 14:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356842; cv=none; d=google.com; s=arc-20160816; b=U2mDV0AjpINBqPPsPQNsWMn1BxYQxZxb/EOgJ+mrWbLXNiCJkS9lxOC17ZuxNmh1NG WRulUPJB4Acax7PpJ1bUIhITLw6OAIf3NGMd52gEtSRCwojW5Sw9WIfWqgjWWVFYf+/5 AfNAmrsYdZYb/h9fUaLyoK3Ewyxyjrj5nLrFLe2Z5ThW9Di4Xm+WEnhsyydgDmTete5R YwT0ytjThQ5f+U7qDK5a0Z3r9OVeXGpt8tq9Z797pKj5EqPq4nXA44j0XLk8ykTSxr6t Ok8w3q5c7C+pBh3O8r3YCbDI7/CboCQw7Le4dlAVqFAaI3NyjivOozA469i2hqJRxykN qhPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from; bh=HJcVGxldrf/ysT/X1mUlCD8Dd3iJiKGpm1C9rwWIS+o=; b=XBNw+XY54LhgX3aaKWNk8u0s3asAA7gIEZw0QmXkBWvf312ECSqEinGoJkjd0gHNjd nQGVORZ1AFmkdq0ndLqZ33fSWeu9Szx4ETHEOPMnrSrai8l+bBM4eZOO+aPxOpGP4ewu 83ETaOnPGYWyOZHXFMwrJNYniHxu//0HmMC8WoITZdgySk4F23Ii1MJP4QYL1jeDqY7I 38m+HkADMr5458rjvs9yZDYQLw2eZcW/dptVsvrFjnc/Q90sS95uyn4ngKqjO6OPiAhL skFcFqb9byYDmG8GTU42qBRkgV1dzQftHxAb9Yncya5blVLEQE8UnCTGfTqFD6pWTLgP emlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19-v6si9931913pgi.388.2018.09.07.14.47.07; Fri, 07 Sep 2018 14:47:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731153AbeIHC2W (ORCPT + 99 others); Fri, 7 Sep 2018 22:28:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58150 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730425AbeIHC2V (ORCPT ); Fri, 7 Sep 2018 22:28:21 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9C82B1007; Fri, 7 Sep 2018 21:45:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars-Peter Clausen , Alexandru Ardelean , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 3.18 09/29] iio: ad9523: Fix return value for ad952x_store() Date: Fri, 7 Sep 2018 23:10:30 +0200 Message-Id: <20180907210910.250323726@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210909.523240901@linuxfoundation.org> References: <20180907210909.523240901@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lars-Peter Clausen commit 9a5094ca29ea9b1da301b31fd377c0c0c4c23034 upstream. A sysfs write callback function needs to either return the number of consumed characters or an error. The ad952x_store() function currently returns 0 if the input value was "0", this will signal that no characters have been consumed and the function will be called repeatedly in a loop indefinitely. Fix this by returning number of supplied characters to indicate that the whole input string has been consumed. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean Fixes: cd1678f96329 ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator") Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/frequency/ad9523.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/frequency/ad9523.c +++ b/drivers/iio/frequency/ad9523.c @@ -507,7 +507,7 @@ static ssize_t ad9523_store(struct devic return ret; if (!state) - return 0; + return len; mutex_lock(&indio_dev->mlock); switch ((u32)this_attr->address) {