All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: Michael Krufky <mkrufky@kernellabs.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartmann <greg@kroah.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Kay Sievers <kay.sievers@vrfy.org>,
	linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH 4/6] dvb/dvb-usb: prepare for FIRMWARE_NAME_MAX removal
Date: Tue, 26 May 2009 20:42:17 +0200	[thread overview]
Message-ID: <20090526184216.GA10560@sortiz.org> (raw)
In-Reply-To: <37219a840905261132q6b0a7289x3408fb904ddf90df@mail.gmail.com>

On Tue, May 26, 2009 at 02:32:45PM -0400, Michael Krufky wrote:
> On Tue, May 26, 2009 at 1:40 PM, Samuel Ortiz <sameo@linux.intel.com> wrote:
> > From: Samuel Ortiz <sameo@linux.intel.com>
> > To: Mauro Carvalho Chehab <mchehab@infradead.org>
> >
> > We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any
> > firmware name length restriction.
> > This patch changes the dvb_usb_device_properties firmware field accordingly.
> >
> > Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
> >
> > ---
> >  drivers/media/dvb/dvb-usb/dvb-usb.h |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Index: iwm-2.6/drivers/media/dvb/dvb-usb/dvb-usb.h
> > ===================================================================
> > --- iwm-2.6.orig/drivers/media/dvb/dvb-usb/dvb-usb.h    2009-05-26 17:24:36.000000000 +0200
> > +++ iwm-2.6/drivers/media/dvb/dvb-usb/dvb-usb.h 2009-05-26 17:25:19.000000000 +0200
> > @@ -196,7 +196,7 @@ struct dvb_usb_device_properties {
> >  #define CYPRESS_FX2     3
> >        int        usb_ctrl;
> >        int        (*download_firmware) (struct usb_device *, const struct firmware *);
> > -       const char firmware[FIRMWARE_NAME_MAX];
> > +       const char *firmware;
> >        int        no_reconnect;
> >
> >        int size_of_priv;
> >
> > --
> > Intel Open Source Technology Centre
> > http://oss.intel.com/
> > --
> > 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/
> >
> 
> Samuel,
> 
> Your patch makes the following change:
> 
> -       const char firmware[FIRMWARE_NAME_MAX];
> +       const char *firmware;
> 
> Before your change, struct dvb_usb_device_properties actually contains
> memory allocated for the firmware filename.  After your change, this
> is nothing but a pointer.
> 
> This will cause an OOPS.
No, not if it's correctly initialized, as it seems to be for all the
dvb_usb_device_properties users right now.
Typically, you'd initialize your dvb_usb_device_properties like this:

static struct dvb_usb_device_properties a800_properties = {
        .caps = DVB_USB_IS_AN_I2C_ADAPTER,

        .usb_ctrl = CYPRESS_FX2,
        .firmware = "dvb-usb-avertv-a800-02.fw",
[...]

And that's fine.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  reply	other threads:[~2009-05-26 18:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 17:40 [PATCH 0/6] firmware: dynamic firmware id allocation Samuel Ortiz
2009-05-26 17:40 ` [PATCH 1/6] firmware: allocate firmware id dynamically Samuel Ortiz
2009-05-26 17:40 ` [PATCH 2/6] atm/ueagle-atm: prepare for FIRMWARE_NAME_MAX removal Samuel Ortiz
2009-05-26 17:40 ` [PATCH 3/6] tuners/xc2028: " Samuel Ortiz
2009-05-26 17:40 ` [PATCH 4/6] dvb/dvb-usb: " Samuel Ortiz
2009-05-26 18:32   ` Michael Krufky
2009-05-26 18:42     ` Samuel Ortiz [this message]
2009-05-26 18:44       ` Michael Krufky
2009-05-26 17:40 ` [PATCH 5/6] pcmcia/ds: " Samuel Ortiz
2009-05-26 17:40 ` [PATCH 6/6] firmware: " Samuel Ortiz
2009-05-26 19:04 ` [PATCH 0/6] firmware: dynamic firmware id allocation John W. Linville

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20090526184216.GA10560@sortiz.org \
    --to=sameo@linux.intel.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mkrufky@kernellabs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.