Re: [PATCH] tty: serial: add error handling for try_module_get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 12, 2018 at 7:50 AM, Zhouyang Jia <jiazhouyang09@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux