Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569425
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Usb: host - Fix possible NULL derefrence. |
| Date | 2017-01-30 08:00 +0100 |
| Message-ID | <t5e6u-I2-1@gated-at.bofh.it> (permalink) |
| References | <t5cxI-8lg-7@gated-at.bofh.it> <t5cxI-8lg-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Jan 30, 2017 at 10:36:29AM +0530, Shailendra Verma wrote:
> of_device_get_match_data could return NULL, and so can cause
> a NULL pointer dereference later.
>
> Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
> ---
> drivers/usb/host/xhci-tegra.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index a59fafb..890c778 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -903,6 +903,10 @@ static int tegra_xusb_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> tegra->soc = of_device_get_match_data(&pdev->dev);
> + if (!tegra->soc) {
How would the driver be loaded and the probe function called if this
returns NULL?
Is this ever possible?
thanks,
greg k-h
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] Usb: host - Fix possible NULL derefrence. Shailendra Verma <shailendra.v@samsung.com> - 2017-01-30 06:20 +0100
Re: [PATCH] Usb: host - Fix possible NULL derefrence. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-30 08:00 +0100
Re: [PATCH] Usb: host - Fix possible NULL derefrence. Thierry Reding <thierry.reding@gmail.com> - 2017-01-30 08:20 +0100
csiph-web