Possible race in cpia.c?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I noticed the following code in cpia.c:

static int cpia_open(struct video_device *dev, int flags)
{
    int i;
    struct cam_data *cam = dev->priv;

    if (!cam) {
        DBG("Internal error, cam_data not found!\n");
        return -EBUSY;
    }

    if (cam->open_count > 0) {
        DBG("Camera already open\n");
        return -EBUSY;
    }

Is it possible (although extremely unlikely) that two processes could try 
and open a device at the same time and both of them believe that 
cam->open_count == 0 ?  If so, given the unlikely nature of this 
possibility, should it be a concern?

-Joe





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux