From: Joe Perches <joe@perches.com>
To: Miche Baker-Harvey <miche@google.com>
Cc: xen-devel@lists.xensource.com,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
Anton Blanchard <anton@samba.org>,
Amit Shah <amit.shah@redhat.com>
Subject: Re: [PATCH] VirtioConsole support.
Date: Fri, 28 Oct 2011 05:55:58 +0300 [thread overview]
Message-ID: <1319770558.2529.20.camel@Joe-Laptop> (raw)
In-Reply-To: <1319751802-27013-1-git-send-email-miche@google.com>
On Thu, 2011-10-27 at 14:43 -0700, Miche Baker-Harvey wrote:
> Multiple HVC console terminals enabled.
Just a note on allocation.
> diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
[]
> @@ -845,6 +857,19 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
> kref_init(&hp->kref);
>
> INIT_WORK(&hp->tty_resize, hvc_set_winsz);
> + /*
> + * make each console its own struct console.
> + * No need to do allocation and copy under lock.
> + */
> + cp = kzalloc(sizeof(*cp), GFP_KERNEL);
> + if (!cp) {
> + kfree(hp);
> + mutex_unlock(&hvc_ports_mutex);
> + return ERR_PTR(-ENOMEM);
> + }
> + memcpy(cp, &hvc_console, sizeof(*cp));
The kzalloc should be kmalloc as the allocated
memory is immediately overwritten.
next prev parent reply other threads:[~2011-10-28 2:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20111027173527.GA23839@phenom.dumpdata.com>
2011-10-27 18:39 ` [PATCH] VirtioConsole support Miche Baker-Harvey
2011-10-27 21:43 ` Miche Baker-Harvey
[not found] ` <1319751802-27013-1-git-send-email-miche@google.com>
2011-10-27 21:55 ` Konrad Rzeszutek Wilk
2011-10-28 16:27 ` Greg KH
2011-10-28 2:55 ` Joe Perches [this message]
2011-10-28 18:19 ` Stephen Boyd
[not found] ` <4EAAF23C.8050102@codeaurora.org>
2011-11-02 22:02 ` Rusty Russell
2011-11-03 12:38 ` Christian Borntraeger
2011-11-03 14:15 ` Konrad Rzeszutek Wilk
[not found] ` <1319740793-2187-1-git-send-email-miche@google.com>
2011-10-27 21:15 ` Konrad Rzeszutek Wilk
2011-10-31 9:55 ` Amit Shah
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=1319770558.2529.20.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=amit.shah@redhat.com \
--cc=anton@samba.org \
--cc=benh@kernel.crashing.org \
--cc=gregkh@suse.de \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miche@google.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox