From: Jiri Slaby <jirislaby@gmail.com>
To: Denis Vlasenko <vda@ilport.com.ua>
Cc: Lion Vollnhals <lion.vollnhals@web.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use kzalloc instead of malloc+memset
Date: Tue, 13 Sep 2005 13:27:21 +0200 [thread overview]
Message-ID: <4326B799.70408@gmail.com> (raw)
In-Reply-To: <200509130841.34104.vda@ilport.com.ua>
Denis Vlasenko napsal(a):
>On Tuesday 13 September 2005 01:47, Lion Vollnhals wrote:
>
>
>>On Tuesday 13 September 2005 00:10, Lion Vollnhals wrote:
>>
>>
>>>This patch against 2.6.13-mm3 replaces malloc and memset with kzalloc in
>>>drivers/base/class.c .
>>>
>>>
>>The following patch converts further kmalllocs and memsets in drivers/base/* to kzallocs.
>>
>>Please apply.
>>
>>Signed-off-by: Lion Vollnhals <webmaster@schiggl.de>
>>
>>
>
>
>
>>diff -Nurp 2.6.13-mm3/drivers/base/platform.c 2.6.13-mm3-changed/drivers/base/platform.c
>>--- 2.6.13-mm3/drivers/base/platform.c 2005-09-12 23:42:47.000000000 +0200
>>+++ 2.6.13-mm3-changed/drivers/base/platform.c 2005-09-13 00:23:43.000000000 +0200
>>@@ -225,13 +225,12 @@ struct platform_device *platform_device_
>> struct platform_object *pobj;
>> int retval;
>>
>>- pobj = kmalloc(sizeof(struct platform_object) + sizeof(struct resource) * num, GFP_KERNEL);
>>+ pobj = kzalloc(sizeof(struct platform_object) + sizeof(struct resource) * num, GFP_KERNEL);
>> if (!pobj) {
>> retval = -ENOMEM;
>> goto error;
>> }
>>
>>- memset(pobj, 0, sizeof(*pobj));
>>
>>
>
>Was this a bug or did you just introduced one?
>
>
Yes, this was a bug.
--
Jiri Slaby www.fi.muni.cz/~xslaby
~\-/~ jirislaby@gmail.com ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10
next prev parent reply other threads:[~2005-09-13 11:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 22:10 [PATCH] use kzalloc instead of malloc+memset Lion Vollnhals
2005-09-12 22:47 ` Lion Vollnhals
2005-09-13 5:41 ` Denis Vlasenko
2005-09-13 11:27 ` Jiri Slaby [this message]
2005-09-12 22:58 ` Jiri Slaby
2005-09-13 4:43 ` Pekka Enberg
2005-09-13 5:33 ` Dmitry Torokhov
2005-09-13 6:42 ` Andrew Morton
2005-09-13 7:02 ` Pekka J Enberg
2005-09-13 7:42 ` Nikita Danilov
2005-09-13 16:31 ` Pekka Enberg
2005-09-14 5:02 ` Denis Vlasenko
2005-09-14 9:58 ` Nikita Danilov
2005-09-13 23:28 ` Paul Jackson
2005-09-14 9:33 ` Bernd Petrovitsch
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=4326B799.70408@gmail.com \
--to=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lion.vollnhals@web.de \
--cc=vda@ilport.com.ua \
/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