Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2324475imm; Fri, 7 Sep 2018 14:40:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZnujJ/wqfhzUKZM2gOsfnTFeKcWfhXcNc2foNcX2/IkKMzhRX+ItJff7uC3sDmQB2Th2kt X-Received: by 2002:a63:2506:: with SMTP id l6-v6mr10239318pgl.343.1536356455282; Fri, 07 Sep 2018 14:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356455; cv=none; d=google.com; s=arc-20160816; b=pH2ywnBMa1PLhOvR7nZqOeWUMFp+8Fx2uLwWo619QBO0qFq15mvWDOSlohX9YXXJwM FTtYhgz3hSHWWvLD5RcKo4P6cVJiPSWhHXh2HF+yO20Nx2cJX3PqlO17keSONq2CRUCA 2eE1wm+NYHTpKu3NwCCScT7a7deeYg580A0dnlzltGU9clugHdF/guVxIfNhVLb8BZ8N h5MuZH5xpKJezHFOeKUKpjlsh0x/3wGZxAAJ2/uP/+ayKqr8mI2TczH7bZDlEvchWLC0 NcmrvdNqt6IYva6YmEghDHL/EQJAVx7wlF4E2AeFie0F19TfTHTU5K+ta/5DIMLKyM0w 4+Lg== 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=L+d7i3JbeIorSBeWBRMMoZm/2XWmvBOZagl7xP4mnl4=; b=rVCjlBTlOkWmuRC3vHJnyQG38WPxiuSxrD4e9hAx68Q689bYLpxObRWCW2jR2+AK2n ajFa8nJDj8EKvuxMYvYRLxPf8EvMTTo/MVf6rYaKvmp82r/oa0ECyLVj7QGiQPfg3xKZ stnXOgpiR8VzgmlFf+W9up/SAtyUyjM+3O3Vet2iLRJog5oBETWieyHrnRpSiC0eUfbE LXAmXa2uEpV1LqBRQ0BXZD7AzTtoVvfYNRps8X8cBtUvKy8qjnu9PeqTqGUzj/S5baDF W4gIB09tBdsFmjH3igRHYSXmo/KuM4uUB9fHFtCeqqJ8tkuIqkh6MekOzjM17vIQPjhX UaWg== 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 cf16-v6si9959251plb.254.2018.09.07.14.40.40; Fri, 07 Sep 2018 14:40:55 -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 S1730047AbeIHCWb (ORCPT + 99 others); Fri, 7 Sep 2018 22:22:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52808 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727681AbeIHCWb (ORCPT ); Fri, 7 Sep 2018 22:22:31 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8DAE0EC3; Fri, 7 Sep 2018 21:39:36 +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 4.4 16/47] iio: ad9523: Fix return value for ad952x_store() Date: Fri, 7 Sep 2018 23:10:12 +0200 Message-Id: <20180907210906.133115568@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210904.607934824@linuxfoundation.org> References: <20180907210904.607934824@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 4.4-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) {