All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Nazarewicz" <mina86@mina86.com>
To: "Per Forlin" <per.forlin@linaro.org>
Cc: "Felipe Balbi" <balbi@ti.com>,
	"Greg Kroah-Hartman" <gregkh@suse.de>,
	"Per Forlin" <per.forlin@stericsson.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linaro-dev@lists.linaro.org
Subject: Re: [PATCH v4] usb: gadget: storage_common: make FSG_NUM_BUFFERS variable size
Date: Fri, 19 Aug 2011 14:52:07 +0200	[thread overview]
Message-ID: <op.v0goo5cc3l0zgt@mnazarewicz-glaptop> (raw)
In-Reply-To: <CAJ0pr1_3xdm3qB=AkcuriMpV6RP-47pg+YLNB7YwPuagA0vnEg@mail.gmail.com>

On Fri, 19 Aug 2011 13:42:08 +0200, Per Forlin <per.forlin@linaro.org>  
wrote:
> Is it true that fsg_common_init() will never be called twice to
> initialise the same fsg_common structure. It is always called once
> followed by release.
> If this is the case it is safe to only:
> if (common->buffhds)
>   common->buffhds = kzalloc()

You should just always do common->buffhds = kcalloc(fsg_num_buffhds,
sizeof *common->buffhds, GFP_KERNEL) in fsg_common_init() and then
kfree() in release.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@google.com>-----ooO--(_)--Ooo--

      reply	other threads:[~2011-08-19 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  9:28 [PATCH v4] usb: gadget: storage_common: make FSG_NUM_BUFFERS variable size Per Forlin
2011-08-18 11:14 ` Felipe Balbi
2011-08-18 11:31   ` Per Forlin
2011-08-18 15:08     ` Alan Stern
2011-08-18 12:28 ` Michal Nazarewicz
2011-08-19  8:39   ` Per Forlin
2011-08-19 10:45     ` Michal Nazarewicz
2011-08-19 11:42       ` Per Forlin
2011-08-19 12:52         ` Michal Nazarewicz [this message]

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=op.v0goo5cc3l0zgt@mnazarewicz-glaptop \
    --to=mina86@mina86.com \
    --cc=balbi@ti.com \
    --cc=gregkh@suse.de \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=per.forlin@linaro.org \
    --cc=per.forlin@stericsson.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.