public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Edwin Török found the following, so fix it
@ 2009-11-26 15:22 Alan Cox
  2009-11-26 16:46 ` Éric Piel
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2009-11-26 15:22 UTC (permalink / raw)
  To: mchehab, linux-kernel

In function ‘memset’,
inlined from ‘ir_input_init’ at drivers/media/common/ir-functions.c:67:
/home/edwin/builds/linux-2.6/arch/x86/include/asm/string_64.h:61:
warning: call to ‘__warn_memset_zero_len’ declared with attribute
warning: memset used with constant zero length parameter; this could be
due to transposed parameters
memset(ir->ir_codes, sizeof(ir->ir_codes), 0);


In actual practice the only caller I can find happens to already have cleared
the buffer before calling ir_input_init.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/media/common/ir-functions.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c
index 98b5125..fc2d894 100644
--- a/drivers/media/common/ir-functions.c
+++ b/drivers/media/common/ir-functions.c
@@ -64,7 +64,7 @@ void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
 
 	ir->ir_type = ir_type;
 
-	memset(ir->ir_codes, sizeof(ir->ir_codes), 0);
+	memset(ir->ir_codes, 0, sizeof(ir->ir_codes));
 
 	/*
 	 * FIXME: This is a temporary workaround to use the new IR tables


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Edwin Török found the following, so fix it
  2009-11-26 15:22 [PATCH] Edwin Török found the following, so fix it Alan Cox
@ 2009-11-26 16:46 ` Éric Piel
  2009-11-26 17:47   ` [PATCH] Edwin T??r??k " Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Éric Piel @ 2009-11-26 16:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, mchehab, linux-kernel, Hank Janssen

Op 26-11-09 16:22, Alan Cox schreef:
> In function ‘memset’,
> inlined from ‘ir_input_init’ at drivers/media/common/ir-functions.c:67:
> /home/edwin/builds/linux-2.6/arch/x86/include/asm/string_64.h:61:
> warning: call to ‘__warn_memset_zero_len’ declared with attribute
> warning: memset used with constant zero length parameter; this could be
> due to transposed parameters
> memset(ir->ir_codes, sizeof(ir->ir_codes), 0);
Hello,
A "grep -E "memset.*,.*, 0\\)" -r" also reports
drivers/staging/hv/StorVsc.c as a suspect:
memset(request, sizeof(struct storvsc_request_extension), 0);
memset(vstorPacket, sizeof(struct vstor_packet), 0);
memset(vstorPacket, sizeof(struct vstor_packet), 0);
memset(vstorPacket, sizeof(struct vstor_packet), 0);

Maybe someone cares about fixing it too?

Cheers,
Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Edwin T??r??k found the following, so fix it
  2009-11-26 16:46 ` Éric Piel
@ 2009-11-26 17:47   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-11-26 17:47 UTC (permalink / raw)
  To: ??ric Piel; +Cc: Alan Cox, mchehab, linux-kernel, Hank Janssen

On Thu, Nov 26, 2009 at 05:46:03PM +0100, ??ric Piel wrote:
> Op 26-11-09 16:22, Alan Cox schreef:
> > In function ???memset???,
> > inlined from ???ir_input_init??? at drivers/media/common/ir-functions.c:67:
> > /home/edwin/builds/linux-2.6/arch/x86/include/asm/string_64.h:61:
> > warning: call to ???__warn_memset_zero_len??? declared with attribute
> > warning: memset used with constant zero length parameter; this could be
> > due to transposed parameters
> > memset(ir->ir_codes, sizeof(ir->ir_codes), 0);
> Hello,
> A "grep -E "memset.*,.*, 0\\)" -r" also reports
> drivers/staging/hv/StorVsc.c as a suspect:
> memset(request, sizeof(struct storvsc_request_extension), 0);
> memset(vstorPacket, sizeof(struct vstor_packet), 0);
> memset(vstorPacket, sizeof(struct vstor_packet), 0);
> memset(vstorPacket, sizeof(struct vstor_packet), 0);
> 
> Maybe someone cares about fixing it too?

It's already fixed in linux-next and will be sent to Linus soon.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-26 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26 15:22 [PATCH] Edwin Török found the following, so fix it Alan Cox
2009-11-26 16:46 ` Éric Piel
2009-11-26 17:47   ` [PATCH] Edwin T??r??k " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox