Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2582195ybx; Fri, 8 Nov 2019 06:26:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxp30fGebjMBf39D8FcQHwYgbmcPDCZ9t7S0frP9UZygY9dKHUOSlU2z2p9HOyKfHocIBwD X-Received: by 2002:aa7:d642:: with SMTP id v2mr10353103edr.175.1573223168019; Fri, 08 Nov 2019 06:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573223168; cv=none; d=google.com; s=arc-20160816; b=u3Yg6zvyXxrh/NiRDofN63we9nnvAvH9KMr9Y4xDPxPSXXK4ywYqEVbRvZ4g19FXax E/InJUrCRvUzdEZYqCjtqXCU9mmIihGWcpwgaG0drziw/ov7eQca1sTXoU6h2mivOaBx lS+retpGx2IGjsm8xjdroPPxgzpP9XITKP6iLfwroaDEx7u+qic6xFlEjnn38PdP9iGQ L/TE0x9toUlW90LQPiVIl8ZOBVClXJkT33pot2/BmduzUyTwoaaPo8htpvc+5jsA73UH bs4TZ0da3c8JCB19h2IMn4uSxiBzGqC5LutyMTy7umaL/P+qc29mQxogT1CwFpWXyBoC Oytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=JSdryO8eXVojEIgiGi6/MOU8GHzrDfHfveNE8M0VA90=; b=SOCSV2nmH+kbT9elatsjQjwMG6AuFLcErFcSoUEMCfchgE6o9a3jS16RDc4TvLK1v2 xy4/CBktXjQ7RwXT+8EujF5Sy+cznwOEtN8XxjBfXpjQyrIYDYlZsOz0zhpR+u/EGraG EYyd7ktySNFrc3Zb4togiwDJtA5Vy/Uh2MMuH8HeTl95tCiYJEwJBYVsNFpqbjC7bvYx O5TFWMas74JzKQmLbqAowBjXi4YTUnCGW8lpyKDsA8CfNCZb5rUeOSUoa9hJDS5oD7ze kRf4bixCIF78yubz1R6JI2t5+MGxZuwLvBRlsK5vTb1yrmo7Ol4RFRQmbJZDYOodzZ7g 5gdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AtUZYW3J; 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 z58si4173530edz.141.2019.11.08.06.25.43; Fri, 08 Nov 2019 06:26:08 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AtUZYW3J; 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 S1726952AbfKHOYq (ORCPT + 99 others); Fri, 8 Nov 2019 09:24:46 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34669 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbfKHOYp (ORCPT ); Fri, 8 Nov 2019 09:24:45 -0500 Received: by mail-pl1-f196.google.com with SMTP id k7so4162582pll.1; Fri, 08 Nov 2019 06:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JSdryO8eXVojEIgiGi6/MOU8GHzrDfHfveNE8M0VA90=; b=AtUZYW3J0oNtdFnuggazotKKoiYQGbkNOGQNhTI8Ly7D7GuZ+mwqFssMKhSS2pY2oy KRcxfbsGCuX780NlynrPwAY3ssLO98dF1QR+l6Tlv5x5F3YkUg6TuDmjDZY3ln890zbe qYXaAD7vETGYXBFSgLVmRiTD/f//Ma5ytkiPocr4yK4ySZQrDupogLO5XB/LtvEtbXPi eaG4WWlsxrl/n6pm5lCCo1DWbzLpUK72QfiIVVP/TqBxUjKZ8IWccydNIWr01IxljNmT jETtSto8V+BUNQnlXLK5nGgOEjqFB10xi3ODQPxMqGosbhfzTnfa9LHXP5orMhg8Ti/N h8cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JSdryO8eXVojEIgiGi6/MOU8GHzrDfHfveNE8M0VA90=; b=QgZtyrr744fR38N10f4IxKhoygev/m8lzEKQjaoeb1yEP+V2Yog42jdKg4J0kQJtNZ B+wFop5NrYZjn5nU6UbpDdYx2lKVQAbZloAbT5IQwdVOaPDxjAAXFNCtuBZKEyvDpJES GxC3XZncLpRf5usfiqyoS4z/Q4reqOOjXg5axC1f7hTzEyEI4KbPWtnwNTl//ey43iMJ flbz66WRLeLAmKRIXOPd25txMEE4xFVbrIJfGK/YW2Bh+7fPfLG8Ad9ZF6Vcmusnr8iF 6YhWTbEuV2ypKxsCsI2f1RxETT93FMCZNoBnyWr76dTfoCQXD8z5B+DfHqarKnsLuXQv ZbYQ== X-Gm-Message-State: APjAAAVw1UnVQvi9AszcEKSG7RwVGN7Bnwm0nYSZe7dkFRZAhEaFNX3M xF2C55FFhgotC2wVQMrYtiuzBPox X-Received: by 2002:a17:902:b203:: with SMTP id t3mr10340394plr.51.1573223084656; Fri, 08 Nov 2019 06:24:44 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e59sm9000783pjk.28.2019.11.08.06.24.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 06:24:43 -0800 (PST) Subject: Re: [PATCH] watchdog: sprd: Fix the incorrect pointer getting from driver data To: Baolin Wang , wim@linux-watchdog.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang7@gmail.com, dongwei.wang@unisoc.com, shuiqing.li@unisoc.com, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <76d4687189ec940baa90cb8d679a8d4c8f02ee80.1573210405.git.baolin.wang@linaro.org> From: Guenter Roeck Message-ID: <3cd61e17-0fd1-6900-47bf-04fcfdef9108@roeck-us.net> Date: Fri, 8 Nov 2019 06:24:41 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <76d4687189ec940baa90cb8d679a8d4c8f02ee80.1573210405.git.baolin.wang@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/8/19 2:57 AM, Baolin Wang wrote: > From: Shuiqing Li > > The device driver data saved the 'struct sprd_wdt' object, it is > incorrect to get 'struct watchdog_device' object from the driver > data, thus fix it. > > Fixes: 477603467009 ("watchdog: Add Spreadtrum watchdog driver") > Reported-by: Dongwei Wang > Signed-off-by: Shuiqing Li > Signed-off-by: Baolin Wang Reviewed-by: Guenter Roeck > --- > drivers/watchdog/sprd_wdt.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/watchdog/sprd_wdt.c b/drivers/watchdog/sprd_wdt.c > index 0bb17b0..65cb55f 100644 > --- a/drivers/watchdog/sprd_wdt.c > +++ b/drivers/watchdog/sprd_wdt.c > @@ -327,10 +327,9 @@ static int sprd_wdt_probe(struct platform_device *pdev) > > static int __maybe_unused sprd_wdt_pm_suspend(struct device *dev) > { > - struct watchdog_device *wdd = dev_get_drvdata(dev); > struct sprd_wdt *wdt = dev_get_drvdata(dev); > > - if (watchdog_active(wdd)) > + if (watchdog_active(&wdt->wdd)) > sprd_wdt_stop(&wdt->wdd); > sprd_wdt_disable(wdt); > > @@ -339,7 +338,6 @@ static int __maybe_unused sprd_wdt_pm_suspend(struct device *dev) > > static int __maybe_unused sprd_wdt_pm_resume(struct device *dev) > { > - struct watchdog_device *wdd = dev_get_drvdata(dev); > struct sprd_wdt *wdt = dev_get_drvdata(dev); > int ret; > > @@ -347,7 +345,7 @@ static int __maybe_unused sprd_wdt_pm_resume(struct device *dev) > if (ret) > return ret; > > - if (watchdog_active(wdd)) { > + if (watchdog_active(&wdt->wdd)) { > ret = sprd_wdt_start(&wdt->wdd); > if (ret) { > sprd_wdt_disable(wdt); >