lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3cd61e17-0fd1-6900-47bf-04fcfdef9108@roeck-us.net>
Date:   Fri, 8 Nov 2019 06:24:41 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Baolin Wang <baolin.wang@...aro.org>, wim@...ux-watchdog.org
Cc:     orsonzhai@...il.com, zhang.lyra@...il.com, baolin.wang7@...il.com,
        dongwei.wang@...soc.com, shuiqing.li@...soc.com,
        linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] watchdog: sprd: Fix the incorrect pointer getting from
 driver data

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

Reviewed-by: Guenter Roeck <linux@...ck-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);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ