lkml.org 
[lkml]   [2007]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: dvb shared datastructure bug?
    On Tue, Feb 13, 2007 at 03:14:23PM +0400, Manu Abraham wrote:
    > >thanks for pointing out this issue.
    > >
    > >attached find a patch that fixes the problem.
    > >
    > >@mauro - please pull changeset a7ac92d208fe
    > > dvbdev: fix illegal re-usage of fileoperations struct
    > >
    > >from http://www.linuxtv.org/hg/~mws/v4l-dvb-fixtree
    > >
    >
    > Ack'd-by: Manu Abraham <manu@linuxtv.org>

    Wouldn't it be better to kmalloc both struct dvb_device and
    struct file_operations together instead of doing 2 separate allocations?
    struct dvd_device_plus_fops
    {
    struct dvb_device dev;
    struct file_operations fops;
    } *dev_fops = kmalloc (sizeof (struct dvd_device_plus_fops), GFP_KERNEL);
    *pdvbdev = dvbdev = (struct dvb_device *)dev_fops;
    if (dev_fops == NULL)
    error handling;
    memset (&dev_fops->fops, 0, sizeof (dev_fops->fops));
    ...
    dvbdev->fops = &dev_fops->fops;

    Jakub
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-02-13 12:39    [W:3.321 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site