* [PATCH] media: fix au0828_analog_register() to not free au0828_dev
@ 2014-12-19 23:42 Shuah Khan
2014-12-20 0:27 ` Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2014-12-19 23:42 UTC (permalink / raw)
To: m.chehab, hans.verkuil, prabhakar.csengg, laurent.pinchart
Cc: Shuah Khan, linux-media, linux-kernel
From: Shuah Khan <shuahkh@osg.samsung.com>
au0828_analog_register() frees au0828_dev when it fails to
locate isoc endpoint. au0828_usb_probe() continues with dvb
and rc probe and registration assuming dev is still valid.
When au0828_analog_register() fails to locate isoc endpoint,
it should return without free'ing au0828_dev. Otherwise, the
probe will fail as dev is null when au0828_dvb_register() is
called.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
drivers/media/usb/au0828/au0828-video.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 3bdf132..94b65b8 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1713,7 +1713,6 @@ int au0828_analog_register(struct au0828_dev *dev,
}
if (!(dev->isoc_in_endpointaddr)) {
pr_info("Could not locate isoc endpoint\n");
- kfree(dev);
return -ENODEV;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: fix au0828_analog_register() to not free au0828_dev
2014-12-19 23:42 [PATCH] media: fix au0828_analog_register() to not free au0828_dev Shuah Khan
@ 2014-12-20 0:27 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2014-12-20 0:27 UTC (permalink / raw)
To: Shuah Khan, m.chehab, hans.verkuil, prabhakar.csengg, laurent.pinchart
Cc: linux-media, linux-kernel
On 12/19/2014 04:42 PM, Shuah Khan wrote:
> From: Shuah Khan <shuahkh@osg.samsung.com>
Sorry. That doesn't look right. Looks like my gitconfig
is bad. I can resend the patch.
-- Shuah
>
> au0828_analog_register() frees au0828_dev when it fails to
> locate isoc endpoint. au0828_usb_probe() continues with dvb
> and rc probe and registration assuming dev is still valid.
> When au0828_analog_register() fails to locate isoc endpoint,
> it should return without free'ing au0828_dev. Otherwise, the
> probe will fail as dev is null when au0828_dvb_register() is
> called.
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> drivers/media/usb/au0828/au0828-video.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
> index 3bdf132..94b65b8 100644
> --- a/drivers/media/usb/au0828/au0828-video.c
> +++ b/drivers/media/usb/au0828/au0828-video.c
> @@ -1713,7 +1713,6 @@ int au0828_analog_register(struct au0828_dev *dev,
> }
> if (!(dev->isoc_in_endpointaddr)) {
> pr_info("Could not locate isoc endpoint\n");
> - kfree(dev);
> return -ENODEV;
> }
>
>
--
Shuah Khan
Sr. Linux Kernel Developer
Samsung Open Source Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-20 0:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-19 23:42 [PATCH] media: fix au0828_analog_register() to not free au0828_dev Shuah Khan
2014-12-20 0:27 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).