From: Stefan Achatz <erazor_de@users.sourceforge.net>
To: Dan Carpenter <error27@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] hid: check for kmalloc() failure
Date: Mon, 24 Jan 2011 18:44:33 +0000 [thread overview]
Message-ID: <1295894673.4901.16.camel@neuromancer> (raw)
In-Reply-To: <20110124183213.GA2721@bicker>
Am Montag, den 24.01.2011, 21:32 +0300 schrieb Dan Carpenter:
> Return -ENOMEM if kmalloc() fails.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
> index 1608c8d..c27bc91 100644
> --- a/drivers/hid/hid-roccat-koneplus.c
> +++ b/drivers/hid/hid-roccat-koneplus.c
> @@ -220,6 +220,10 @@ static int koneplus_get_startup_profile(struct usb_device *usb_dev)
> int retval;
>
> buf = kmalloc(sizeof(struct koneplus_startup_profile), GFP_KERNEL);
> + if (!buf) {
> + retval = -ENOMEM;
> + goto out;
> + }
>
> retval = koneplus_receive(usb_dev, KONEPLUS_USB_COMMAND_STARTUP_PROFILE,
> buf, sizeof(struct koneplus_startup_profile));
That was already fixed by Vasiliy Kulikov. The patch was applied to the
roccat branch in Jiri Kosinas hid repository
(dacfecdbf3a0a5072984ff8b3c224a48c8461008).
Thank you anyway.
Stefan
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Achatz <erazor_de@users.sourceforge.net>
To: Dan Carpenter <error27@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] hid: check for kmalloc() failure
Date: Mon, 24 Jan 2011 19:44:33 +0100 [thread overview]
Message-ID: <1295894673.4901.16.camel@neuromancer> (raw)
In-Reply-To: <20110124183213.GA2721@bicker>
Am Montag, den 24.01.2011, 21:32 +0300 schrieb Dan Carpenter:
> Return -ENOMEM if kmalloc() fails.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
> index 1608c8d..c27bc91 100644
> --- a/drivers/hid/hid-roccat-koneplus.c
> +++ b/drivers/hid/hid-roccat-koneplus.c
> @@ -220,6 +220,10 @@ static int koneplus_get_startup_profile(struct usb_device *usb_dev)
> int retval;
>
> buf = kmalloc(sizeof(struct koneplus_startup_profile), GFP_KERNEL);
> + if (!buf) {
> + retval = -ENOMEM;
> + goto out;
> + }
>
> retval = koneplus_receive(usb_dev, KONEPLUS_USB_COMMAND_STARTUP_PROFILE,
> buf, sizeof(struct koneplus_startup_profile));
That was already fixed by Vasiliy Kulikov. The patch was applied to the
roccat branch in Jiri Kosinas hid repository
(dacfecdbf3a0a5072984ff8b3c224a48c8461008).
Thank you anyway.
Stefan
next prev parent reply other threads:[~2011-01-24 18:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 18:32 [patch] hid: check for kmalloc() failure Dan Carpenter
2011-01-24 18:32 ` Dan Carpenter
2011-01-24 18:44 ` Stefan Achatz [this message]
2011-01-24 18:44 ` Stefan Achatz
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=1295894673.4901.16.camel@neuromancer \
--to=erazor_de@users.sourceforge.net \
--cc=error27@gmail.com \
--cc=jkosina@suse.cz \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
/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.