Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1638758 > unrolled thread

Re: [PATCH] Soc: mediatek - Fix possible NULL derefrence.

Started byMatthias Brugger <matthias.bgg@gmail.com>
First post2017-05-10 13:40 +0200
Last post2017-05-10 13:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] Soc: mediatek - Fix possible NULL derefrence. Matthias Brugger <matthias.bgg@gmail.com> - 2017-05-10 13:40 +0200

#1638758 — Re: [PATCH] Soc: mediatek - Fix possible NULL derefrence.

FromMatthias Brugger <matthias.bgg@gmail.com>
Date2017-05-10 13:40 +0200
SubjectRe: [PATCH] Soc: mediatek - Fix possible NULL derefrence.
Message-ID<tFy8i-cT-1@gated-at.bofh.it>

On 27/01/17 12:17, Shailendra Verma wrote:
> of_match_device could return NULL, and so can cause a NULL
> pointer dereference later.
> 
> Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>

I fixed the subject line and queued it for v4.12-next/soc
Sorry for the (huge) delay.

Matthias

> ---
>   drivers/soc/mediatek/mtk-pmic-wrap.c |    5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index a5f1093..c48db98 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -1117,6 +1117,11 @@ static int pwrap_probe(struct platform_device *pdev)
>   	const struct of_device_id *of_slave_id = NULL;
>   	struct resource *res;
>   
> +	if (!of_id) {
> +		dev_err(&pdev->dev, "Error: No device match found\n");
> +		return -ENODEV;
> +	}
> +
>   	if (pdev->dev.of_node->child)
>   		of_slave_id = of_match_node(of_slave_match_tbl,
>   					    pdev->dev.of_node->child);
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web