lkml.org 
[lkml]   [2021]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 2/2] tty: serial: fsl_lpuart: fix the potential bug of dereference null return value
Date
Hi Fabio,

>
> > Thanks for your reply.
> > I guess you mean the of_match_table will not be NULL since it contains
> compatible, right?
> > But for the lpuart data -- struct lpuart_soc_data, won’t it meet the NULL
> case? such as { .compatible = "fsl,imx8qxp-lpuart", }.
> > Here of_device_id won’t be NULL, but lpuart_soc_data Is NULL.
>
> In linux-next we have:
>
> static const struct of_device_id lpuart_dt_ids[] = { { .compatible = "fsl,vf610-
> lpuart", .data = &vf_data, }, { .compatible = "fsl,ls1021a-lpuart", .data =
> &ls1021a_data, }, { .compatible = "fsl,ls1028a-lpuart", .data =
> &ls1028a_data, }, { .compatible = "fsl,imx7ulp-lpuart", .data =
> &imx7ulp_data, }, { .compatible = "fsl,imx8qxp-lpuart", .data =
> &imx8qxp_data, }, { /* sentinel */ } };
>
> All compatible entries have a .data field populated.
>
> How sdata can be NULL?

You are right, seems it is impossible for us to hit this NULL. Will drop this patch.

Best regards
Sherry
\
 
 \ /
  Last update: 2021-04-26 14:51    [W:0.054 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site