Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2979236imu; Sun, 9 Dec 2018 14:10:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/WW/fHV89a385kDO9mXinHVy7NCzYAMeutWTw0CeRnhsevKk+DN9rv2xyZ7Swu9NIts19YU X-Received: by 2002:a62:7dcb:: with SMTP id y194mr10157738pfc.113.1544393420082; Sun, 09 Dec 2018 14:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393420; cv=none; d=google.com; s=arc-20160816; b=vWAF++yq3S7DA+H9323T8E4yNyH6PeEh1tvtU5Ha5AiLv3Emy2QYk5nsBTpJWFii9/ ynvKI4Z5/sjZodtUZZOGtR8DQS7Vy2aeZL2eYHQYCqz0qshcN/5TD6j/aYD3NrtK61Iz bujFnLnxIpzyO9cWwXfv7Hr7RL0IhlHgb/8NLnyp9gsPJ0WfpmuY9zoSM67YaRRDTbwN FY/wnIj1c0nTyUBNuQdPIrR6wZzOlU9LInDmj1XM3m0AOembqy2G5Cfz7xG2NCJkOFfV itPWMF47V+1Im3m9U2RpOSRHae3c5AX9qmQIDi2n301LyYuObfBraXw184OF8oStofjO v1Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=4QbqIoSUTqbHq3kjdJ9XKuiIEhkFdn02pi1gG+rqqrI=; b=sp0B3KvWMRxcMXIdd+8e1srWW7Li3hb3S4EgeFs1+I1fcokxVfM9guBPC/BgDILJYY fZdvypFpwhr28AcMs9A4g0TN6vduR4HOEWZAwJA2aOCs60qqZFbENUzNlqgAeyUYHEtG /XomO5wQww8sv4iZ/4wbwPv72rQdoHzsrIyhPXh4sSafI2qwHG5EjkX0UVb31hDUu6IQ 6qzh1L0JwQB6EpIbp5arruSyW8RfFMxGEWU/14WihJ/7Qxk2f6ys6n11a6/IfRTn2D7y 3NxmPDSxFJfECgdUPad05wJsox3tzpHWJBNQsWfPzbUTOabiIBj8zjoCBSpnE2HYKK7N oepw== 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 3si8834610plo.102.2018.12.09.14.10.05; Sun, 09 Dec 2018 14:10:20 -0800 (PST) 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 S1726934AbeLIWIr (ORCPT + 99 others); Sun, 9 Dec 2018 17:08:47 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37360 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbeLIWIo (ORCPT ); Sun, 9 Dec 2018 17:08:44 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73I-0002iY-T3; Sun, 09 Dec 2018 21:55:53 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72b-0003It-5o; Sun, 09 Dec 2018 21:55:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jonathan Cameron" , "Alexandru Ardelean" , "Lars-Peter Clausen" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 083/328] iio: ad9523: Fix return value for ad952x_store() In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 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") Signed-off-by: Jonathan Cameron Signed-off-by: Ben Hutchings --- 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) {