Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2462250imm; Mon, 28 May 2018 08:31:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrV2hbj02PEdGLncKOTa2PsW6oqm3K4tN/rtpiTiXDJWStb3MqmCpJY9I2d0t5hAvnxhGvh X-Received: by 2002:a62:2218:: with SMTP id i24-v6mr13951061pfi.53.1527521484397; Mon, 28 May 2018 08:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527521484; cv=none; d=google.com; s=arc-20160816; b=a3quT7GfVbOcTKoWhVO47Y1LxkWp+WOZh0tIWBeu9ZIBBqgvgR3ht9TYqszrc9PDh1 h+qxOM3cIkOUmt0n4wHUdgNY7ZeemCWpesKNZArj5SzC1M+c5crEl+sjSLLq4AmwcNSv JcGWwMhsa7RAZUkDLsMrN6mTPnsI6KDrDPYYwK+7gX2rptqNT8pHyB/zuDjbGvXcEP7I Kr99neQwW4yBueQPiLDoxQS+8VuHEirx49O+hjtIFBFZne9f62amNSGovmGmB2c6FPvl YK72BVy1irKqXhxcoaYCgQJgCtWk8pa3X5ZnBvKuEn4Fkru8BggD+aW7C4uc57ApeNBP EsXQ== 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:dkim-signature :arc-authentication-results; bh=d2nLrGFYXQMEs/1ylns5RSfdB3wX3GpUJicjcKEm3bc=; b=iSizjGh8M4oqFa6pEgW2JYsKmg48ldlKIi0u0zDEVKjshAGoxvfcV1q7xJQeQp+olF HyOW6H1gUW/Sl5PP9n8nuIJHWgO4isib50lmNB9Z9cl517zgIYg0/K0HnnGS38EL7zp9 MOX20zqhW01JvsPf8QiGKAKZwdSEXzM7Uv+mr7Fujt+N6gxmvf6+BL2gKDrRxsDNdPdW Q8pEBLNp5pmTWqIm3X+sI+uATc5zNrDeIz4GctF9vtSa8cBWT9KaxAqsqTjAa8rGD7j6 xk5FvXrONCvTu7DkXijFQqABdXbIbYftdAXufhxDf2XcNofASNjaU5nh0Zv8aoRurlI4 OSeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z7JEPYX1; 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 o87-v6si5824931pfi.295.2018.05.28.08.31.09; Mon, 28 May 2018 08:31:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Z7JEPYX1; 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 S1033250AbeE1PaS (ORCPT + 99 others); Mon, 28 May 2018 11:30:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:39408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032770AbeE1KTb (ORCPT ); Mon, 28 May 2018 06:19:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 726EA2086D; Mon, 28 May 2018 10:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502771; bh=U6jpsB2UU2DldqRB3zZyGXXvd2XDi2FldI+dZoPzKvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z7JEPYX1A5wgWfU4jI/vKx22hGmKTXV0zm7JZ1pBciGhEvnV0aGS0hSGOVjEUO/pB IlcXpZExfwk2LuOG8PqLHGJliAVWi5ZgFgYGnisSKpRkWh47D/rSosNj2mdMSqItfz K5jmPPle8znd3v+3Uau0CFam2OqXtIqe0AprBEoI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Igor Pylypiv , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 4.4 123/268] watchdog: f71808e_wdt: Fix magic close handling Date: Mon, 28 May 2018 12:01:37 +0200 Message-Id: <20180528100216.042281572@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@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: Igor Pylypiv [ Upstream commit 7bd3e7b743956afbec30fb525bc3c5e22e3d475c ] Watchdog close is "expected" when any byte is 'V' not just the last one. Writing "V" to the device fails because the last byte is the end of string. $ echo V > /dev/watchdog f71808e_wdt: Unexpected close, not stopping watchdog! Signed-off-by: Igor Pylypiv Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/f71808e_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c @@ -520,7 +520,8 @@ static ssize_t watchdog_write(struct fil char c; if (get_user(c, buf + i)) return -EFAULT; - expect_close = (c == 'V'); + if (c == 'V') + expect_close = true; } /* Properly order writes across fork()ed processes */