From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: check for return value of clk_get() in mpc512x_can_get_clock() Date: Fri, 25 Feb 2011 09:34:37 +0100 Message-ID: <4D67699D.1010301@grandegger.com> References: <201102231435.53991.andrej.krutak@sysgo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andrej Krutak Return-path: In-Reply-To: <201102231435.53991.andrej.krutak-uSbOeAmDUekAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org Errors-To: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org List-Id: netdev.vger.kernel.org Hi, On 02/23/2011 02:35 PM, Andrej Krutak wrote: > Hi, > > just wanted to inform you - in the mpc512x_can_get_clock() function > (drivers/net/can/mscan/mpc5xxx_can.c), there are calls to clg_get(), and later > checks > > if (!sys_clk) { > and > if (!ref_clk) { > > but these should be > > if (IS_ERR(sys_clk)) { > and > if (IS_ERR(ref_clk)) { > > (otherwise you'll get an oops if something goes wrong with clg_get()). Thanks for the info. I'm going to prepare a patch. Wolfgang.