lkml.org 
[lkml]   [2015]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] base/platform: fix panic when probe function is NULL
Hello Martin,

On Tue, Dec 01, 2015 at 11:41:53AM +0100, Wilck, Martin wrote:
> > This sounds like a separate issue though. Looking at init_tis there is:
> >
> > rc = platform_driver_register(&tis_drv);
> > if (rc < 0)
> > return rc;
> > pdev = platform_device_register_simple("tpm_tis", -1, NULL, 0);
> > if (IS_ERR(pdev)) {
> > rc = PTR_ERR(pdev);
> > goto err_dev;
> > }
> > rc = tpm_tis_init(&pdev->dev, &tis_default_info, NULL);
> >
> > tpm_tis_init calls tpmm_chip_alloc which barfs when pdev (i.e. the return value
> > of platform_device_register_simple above) isn't bound. It is not allowed
> > to assume that the device is bound after the above function calls.
>
> Can you please explain again why you think that assumption is invalid?

You can unbind a device from a driver via sysfs, you can also prevent
binding somehow I think, probing can fail for different reasons, probing
might wait for userspace interaction to load firmware which wasn't
scheduled yet. I'm sure there are still more things that break the
assumption.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |


\
 
 \ /
  Last update: 2015-12-01 14:41    [W:0.136 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site