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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170209142425.GC23373@xo-6d-61-c0.localdomain>
Date:   Thu, 9 Feb 2017 15:24:25 +0100
From:   Pavel Machek <pavel@....cz>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Rafael Wysocki <rjw@...ysocki.net>, khilman@...libre.com,
        ulf.hansson@...aro.org, Len Brown <len.brown@...el.com>,
        linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>,
        sboyd@...eaurora.org, nm@...com, robh+dt@...nel.org,
        lina.iyer@...aro.org, rnayak@...eaurora.org
Subject: Re: [PATCH V2 1/6] PM / QOS: Add default case to the switch

On Thu 2017-02-09 09:11:47, Viresh Kumar wrote:
> The switch block handles all the QOS request types present today, but
> starts giving compilation warnings as soon as a new type is added and
> not handled in this.
> 
> To prevent against that, add the default case as well and do a WARN from
> it.

I'd say compilation-time warning is better than hmm.... stacktrace and memory leak
at runtime?

> --- a/drivers/base/power/qos.c
> +++ b/drivers/base/power/qos.c
> @@ -621,6 +621,9 @@ static void __dev_pm_qos_drop_user_request(struct device *dev,
>  		req = dev->power.qos->flags_req;
>  		dev->power.qos->flags_req = NULL;
>  		break;
> +	default:
> +		WARN_ON(1);
> +		return;
>  	}
>  	__dev_pm_qos_remove_request(req);
>  	kfree(req);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ