Message ID | 20230717144809.24895-1-ruc_gongyuanjun@163.com |
---|---|
State | New |
Headers | show |
Series | [1/1] drivers:video: fix return value check in ep93xxfb_probe | expand |
On 7/17/23 16:48, Yuanjun Gong wrote: > function clk_prepare_enable may fail in ep93xxfb_probe, therefore, > add a return value check to clk_prepare_enable and handle the > error. > > Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> applied. Thanks! Helge > --- > drivers/video/fbdev/ep93xx-fb.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c > index 94fe52928be2..22158d9ca8dd 100644 > --- a/drivers/video/fbdev/ep93xx-fb.c > +++ b/drivers/video/fbdev/ep93xx-fb.c > @@ -548,7 +548,9 @@ static int ep93xxfb_probe(struct platform_device *pdev) > } > > ep93xxfb_set_par(info); > - clk_prepare_enable(fbi->clk); > + err = clk_prepare_enable(fbi->clk); > + if (err) > + goto failed_check; > > err = register_framebuffer(info); > if (err)
diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index 94fe52928be2..22158d9ca8dd 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -548,7 +548,9 @@ static int ep93xxfb_probe(struct platform_device *pdev) } ep93xxfb_set_par(info); - clk_prepare_enable(fbi->clk); + err = clk_prepare_enable(fbi->clk); + if (err) + goto failed_check; err = register_framebuffer(info); if (err)
function clk_prepare_enable may fail in ep93xxfb_probe, therefore, add a return value check to clk_prepare_enable and handle the error. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> --- drivers/video/fbdev/ep93xx-fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)