lkml.org 
[lkml]   [2018]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] tty: serial: add error handling for try_module_get
On Tue, Jun 12, 2018 at 7:50 AM, Zhouyang Jia <jiazhouyang09@gmail.com> wrote:
> When try_module_get fails, the lack of error-handling code may
> cause unexpected results.

What results? What is recovery approach here?
How printing message change a behaviour?

> This patch adds error-handling code after calling try_module_get.

> + if (!kgdb_connected) {
> + if (!try_module_get(THIS_MODULE))
> + printk(KERN_ERR "kgdboc: cannot get module.\n");

So, what's wrong with pr_err() ?

> + }

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-06-12 10:24    [W:0.029 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site