From: Fengguang Wu Date: Mon, 30 Jul 2012 21:39:54 +0000 (-0700) Subject: clk: validate pointer in __clk_disable() X-Git-Tag: v3.6-rc1~41^2~105 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e47c6a3408ea6bcfc5204f23d5a5b209de6e68b9;p=pandora-kernel.git clk: validate pointer in __clk_disable() clk_get() returns -ENOENT on error and some careless caller might dereference it without error checking: In mxc_rnga_remove(): struct clk *clk = clk_get(&pdev->dev, "rng"); // ... clk_disable(clk); Since it's insane to audit the lots of existing and future clk users, let's add a check in the callee to avoid kernel panic and warn about any buggy user. Cc: Russell King Cc: Paul Gortmaker Cc: Viresh Kumar Cc: viresh kumar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed