LKML Archive on
help / color / mirror / Atom feed
From: "Manu Abraham" <>
To: "Arjan van de Ven" <>
Subject: Re: [v4l-dvb-maintainer] dvb shared datastructure bug?
Date: Tue, 13 Feb 2007 12:49:04 +0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 2/13/07, Arjan van de Ven <> wrote:
> Hi,
> while working on the last pieces of the file_ops constantification, DVB
> is the small village in France that is holding the Romans at bay... but
> I think I found the final flaw in it now:
>        *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL);
>         if (!dvbdev) {
>                 mutex_unlock(&dvbdev_register_lock);
>                 return -ENOMEM;
>         }
>         memcpy(dvbdev, template, sizeof(struct dvb_device));
>         dvbdev->type = type;
>         dvbdev->id = id;
>         dvbdev->adapter = adap;
>         dvbdev->priv = priv;
>         dvbdev->fops->owner = adap->module;
> this is the place in DVB that is writing to a struct file_operations.
> But as with almost all such cases in the kernel, this one is buggy:
> While the code nicely copies a template dvbdev, that template only has a
> pointer to a *shared* fops struct, the copy doesn't help that. So this
> code is overwriting the fops owner field for ALL active devices, not
> just the ones the copy of the template is for....

While working on a new device node, i stumbled across a similar issue
where attaching the frontend failed due to some sort of memory
corruption. This was seen as all the callbacks suddenly just vanished,
eventhough it existed in the driver

At that point, i figured it could be something due to an error at my
side , since the device that i was working was a bit complex and had
API changes as well.

Thanks for pointing it out. It looks like the issue sounds similar.


  reply	other threads:[~2007-02-13  8:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-13  7:47 Arjan van de Ven
2007-02-13  8:49 ` Manu Abraham [this message]
2007-02-13 11:04 ` Marcel Siegert
2007-02-13 11:14   ` Manu Abraham
2007-02-13 11:35     ` Jakub Jelinek
2007-02-13 12:02       ` Marcel Siegert
2007-02-13 13:09       ` [v4l-dvb-maintainer] " Trent Piepho
2007-02-13 13:21         ` Marcel Siegert
2007-02-13 13:21         ` Manu Abraham
2007-02-13 11:35   ` Arjan van de Ven
2007-02-13 13:05     ` Marcel Siegert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [v4l-dvb-maintainer] dvb shared datastructure bug?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).