lkml.org 
[lkml]   [2016]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] xilinx: check return value of class_create
From
Date
On 10.8.2016 10:08, yizhouzhou@ict.ac.cn wrote:
> From: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
>
> return value of class_create should be considered in
> module init function.
>
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> ---
> drivers/char/xilinx_hwicap/xilinx_hwicap.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> index c07dfe5..3877b46 100644
> --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> @@ -854,6 +854,9 @@ static int __init hwicap_module_init(void)
> int retval;
>
> icap_class = class_create(THIS_MODULE, "xilinx_config");
> + if (IS_ERR(icap_class))
> + return PTR_ERR(icap_class);
> +
> mutex_init(&icap_sem);
>
> devt = MKDEV(XHWICAP_MAJOR, XHWICAP_MINOR);
>

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

\
 
 \ /
  Last update: 2016-08-10 22:41    [W:0.028 / U:26.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site