Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Baolin Wang <baolin.wang@linaro.org>, 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
Subject: Re: [PATCH] watchdog: sprd: Fix the incorrect pointer getting from driver data
Date: Fri, 8 Nov 2019 06:24:41 -0800
Message-ID: <3cd61e17-0fd1-6900-47bf-04fcfdef9108@roeck-us.net> (raw)
In-Reply-To: <76d4687189ec940baa90cb8d679a8d4c8f02ee80.1573210405.git.baolin.wang@linaro.org>

On 11/8/19 2:57 AM, Baolin Wang wrote:
> From: Shuiqing Li <shuiqing.li@unisoc.com>
> 
> 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 <dongwei.wang@unisoc.com>
> Signed-off-by: Shuiqing Li <shuiqing.li@unisoc.com>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   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);
> 


      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 10:57 Baolin Wang
2019-11-08 14:24 ` Guenter Roeck [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cd61e17-0fd1-6900-47bf-04fcfdef9108@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=baolin.wang7@gmail.com \
    --cc=baolin.wang@linaro.org \
    --cc=dongwei.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=shuiqing.li@unisoc.com \
    --cc=wim@linux-watchdog.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git