Re: [PATCH] V4L: fix retval in vivi driver for more than one device

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mauro Carvalho Chehab
Date: Sunday, August 24, 2008 - 7:00 am

This patch is not 100% OK, for some reasons:

1) since ret won't be initialized anymore, it will generate compilation
    warnings;

2) with the current code, if you ask to allocate, let's say, 3 virtual
    drivers, and the second or the third fails, you'll still have one
    allocated. With your change, you'll de-allocate even the ones that
    succeeded. IMO, the better is to allow using the ones that succeeded.

That's said, I can see other issues on the current vivi.c code:

1) what happens if someone uses n_dev=0? It will return a wrong error
    code.

2) there are still some cases where the driver allocates less devices than
    requested, but it will fail to register, and all stuff will be
    de-allocated;

3) what if n_dev is a big number? Currently, i think videodev will allow
    you to register up to 32 video devices of this type, even if you have
    memory for more, due to some limits inside videodev, and due to the
    number of minors allocated for V4L.  IMO, the driver should allocate up
    to the maximum allowed devices by videodev, and let users use they.

Anyway, thanks for your patch. For sure we need to do some fixes here. 
I'll try to address all those stuff into a patch.

Cheers,
Mauro.


On Fri, 22 Aug 2008, Henne wrote:


-- 
Cheers,
Mauro Carvalho Chehab
http://linuxtv.org
mchehab@infradead.org
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] V4L: fix retval in vivi driver for more than o ..., Mauro Carvalho Chehab, (Sun Aug 24, 7:00 am)
Re: [PATCH] V4L: fix retval in vivi driver for more than o ..., Mauro Carvalho Chehab, (Sun Aug 24, 7:58 am)