All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
@ 2017-12-06 12:06 ` SF Markus Elfring
  0 siblings, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-12-06 12:06 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 6 Dec 2017 13:03:21 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/usb/misc/emi26.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index 24d841850e05..654e93857d65 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
 	int result;
 	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
 
-	if (!buffer) {
-		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
+	if (!buffer)
 		return -ENOMEM;
-	}
+
 	/* Note: usb_control_msg returns negative value on error or length of the
 	 * 		 data that was written! */
 	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);
-- 
2.15.1

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

* [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
@ 2017-12-06 12:06 ` SF Markus Elfring
  0 siblings, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-12-06 12:06 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 6 Dec 2017 13:03:21 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/usb/misc/emi26.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index 24d841850e05..654e93857d65 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
 	int result;
 	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
 
-	if (!buffer) {
-		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
+	if (!buffer)
 		return -ENOMEM;
-	}
+
 	/* Note: usb_control_msg returns negative value on error or length of the
 	 * 		 data that was written! */
 	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);
-- 
2.15.1


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

* USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
@ 2017-12-06 12:06 ` SF Markus Elfring
  0 siblings, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-12-06 12:06 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi, Greg Kroah-Hartman, Johan Hovold
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 6 Dec 2017 13:03:21 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/usb/misc/emi26.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index 24d841850e05..654e93857d65 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
 	int result;
 	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
 
-	if (!buffer) {
-		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
+	if (!buffer)
 		return -ENOMEM;
-	}
+
 	/* Note: usb_control_msg returns negative value on error or length of the
 	 * 		 data that was written! */
 	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);

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

* Re: [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
  2017-12-06 12:06 ` [PATCH] " SF Markus Elfring
  (?)
@ 2017-12-06 12:12   ` Julia Lawall
  -1 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2017-12-06 12:12 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, Johan Hovold, LKML,
	kernel-janitors



On Wed, 6 Dec 2017, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 6 Dec 2017 13:03:21 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/usb/misc/emi26.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
> index 24d841850e05..654e93857d65 100644
> --- a/drivers/usb/misc/emi26.c
> +++ b/drivers/usb/misc/emi26.c
> @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
>  	int result;
>  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
>
> -	if (!buffer) {
> -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);

I guess the length information would not be so easy to find in the
backtrace.

julia


> +	if (!buffer)
>  		return -ENOMEM;
> -	}
> +
>  	/* Note: usb_control_msg returns negative value on error or length of the
>  	 * 		 data that was written! */
>  	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);
> --
> 2.15.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory(
@ 2017-12-06 12:12   ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2017-12-06 12:12 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, Johan Hovold, LKML,
	kernel-janitors



On Wed, 6 Dec 2017, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 6 Dec 2017 13:03:21 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/usb/misc/emi26.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
> index 24d841850e05..654e93857d65 100644
> --- a/drivers/usb/misc/emi26.c
> +++ b/drivers/usb/misc/emi26.c
> @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
>  	int result;
>  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
>
> -	if (!buffer) {
> -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);

I guess the length information would not be so easy to find in the
backtrace.

julia


> +	if (!buffer)
>  		return -ENOMEM;
> -	}
> +
>  	/* Note: usb_control_msg returns negative value on error or length of the
>  	 * 		 data that was written! */
>  	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);
> --
> 2.15.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
@ 2017-12-06 12:12   ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2017-12-06 12:12 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, Johan Hovold, LKML,
	kernel-janitors

On Wed, 6 Dec 2017, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 6 Dec 2017 13:03:21 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/usb/misc/emi26.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
> index 24d841850e05..654e93857d65 100644
> --- a/drivers/usb/misc/emi26.c
> +++ b/drivers/usb/misc/emi26.c
> @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
>  	int result;
>  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
>
> -	if (!buffer) {
> -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);

I guess the length information would not be so easy to find in the
backtrace.

julia


> +	if (!buffer)
>  		return -ENOMEM;
> -	}
> +
>  	/* Note: usb_control_msg returns negative value on error or length of the
>  	 * 		 data that was written! */
>  	result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300);
> --
> 2.15.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
  2017-12-06 12:06 ` [PATCH] " SF Markus Elfring
  (?)
@ 2017-12-06 13:18     ` Dan Carpenter
  -1 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2017-12-06 13:18 UTC (permalink / raw)
  To: Julia Lawall
  Cc: SF Markus Elfring, linux-usb, Felipe Balbi, Greg Kroah-Hartman,
	Johan Hovold, LKML, kernel-janitors

On Wed, Dec 06, 2017 at 01:12:32PM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
> 
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Wed, 6 Dec 2017 13:03:21 +0100
> >
> > Omit an extra message for a memory allocation failure in this function.
> >
> > This issue was detected by using the Coccinelle software.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> >  drivers/usb/misc/emi26.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
> > index 24d841850e05..654e93857d65 100644
> > --- a/drivers/usb/misc/emi26.c
> > +++ b/drivers/usb/misc/emi26.c
> > @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
> >  	int result;
> >  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
> >
> > -	if (!buffer) {
> > -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
> 
> I guess the length information would not be so easy to find in the
> backtrace.
> 

I think it prints the "order" but not the exact size.

regards,
dan carpeneter

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

* Re: [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory(
@ 2017-12-06 13:18     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2017-12-06 13:18 UTC (permalink / raw)
  To: Julia Lawall
  Cc: SF Markus Elfring, linux-usb, Felipe Balbi, Greg Kroah-Hartman,
	Johan Hovold, LKML, kernel-janitors

On Wed, Dec 06, 2017 at 01:12:32PM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
> 
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Wed, 6 Dec 2017 13:03:21 +0100
> >
> > Omit an extra message for a memory allocation failure in this function.
> >
> > This issue was detected by using the Coccinelle software.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> >  drivers/usb/misc/emi26.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
> > index 24d841850e05..654e93857d65 100644
> > --- a/drivers/usb/misc/emi26.c
> > +++ b/drivers/usb/misc/emi26.c
> > @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
> >  	int result;
> >  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
> >
> > -	if (!buffer) {
> > -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
> 
> I guess the length information would not be so easy to find in the
> backtrace.
> 

I think it prints the "order" but not the exact size.

regards,
dan carpeneter

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

* USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
@ 2017-12-06 13:18     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2017-12-06 13:18 UTC (permalink / raw)
  To: Julia Lawall
  Cc: SF Markus Elfring, linux-usb, Felipe Balbi, Greg Kroah-Hartman,
	Johan Hovold, LKML, kernel-janitors

On Wed, Dec 06, 2017 at 01:12:32PM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
> 
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Wed, 6 Dec 2017 13:03:21 +0100
> >
> > Omit an extra message for a memory allocation failure in this function.
> >
> > This issue was detected by using the Coccinelle software.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> >  drivers/usb/misc/emi26.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
> > index 24d841850e05..654e93857d65 100644
> > --- a/drivers/usb/misc/emi26.c
> > +++ b/drivers/usb/misc/emi26.c
> > @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
> >  	int result;
> >  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
> >
> > -	if (!buffer) {
> > -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
> 
> I guess the length information would not be so easy to find in the
> backtrace.
> 

I think it prints the "order" but not the exact size.

regards,
dan carpeneter
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
  2017-12-06 12:06 ` [PATCH] " SF Markus Elfring
  (?)
@ 2017-12-06 13:25     ` SF Markus Elfring
  -1 siblings, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-12-06 13:25 UTC (permalink / raw)
  To: Julia Lawall, linux-usb
  Cc: Felipe Balbi, Greg Kroah-Hartman, Johan Hovold, LKML, kernel-janitors

>> @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
>>  	int result;
>>  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
>>
>> -	if (!buffer) {
>> -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
> 
> I guess the length information would not be so easy to find in the backtrace.

Why do you “guess”?


>> +	if (!buffer)
>>  		return -ENOMEM;
>> -	}

Would we like to achieve another consensus on the data which are provided by
a default Linux allocation failure report?

Regards,
Markus

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

* Re: [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory(
@ 2017-12-06 13:25     ` SF Markus Elfring
  0 siblings, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-12-06 13:25 UTC (permalink / raw)
  To: Julia Lawall, linux-usb
  Cc: Felipe Balbi, Greg Kroah-Hartman, Johan Hovold, LKML, kernel-janitors

>> @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
>>  	int result;
>>  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
>>
>> -	if (!buffer) {
>> -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
> 
> I guess the length information would not be so easy to find in the backtrace.

Why do you “guess”?


>> +	if (!buffer)
>>  		return -ENOMEM;
>> -	}

Would we like to achieve another consensus on the data which are provided by
a default Linux allocation failure report?

Regards,
Markus

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

* USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory()
@ 2017-12-06 13:25     ` SF Markus Elfring
  0 siblings, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-12-06 13:25 UTC (permalink / raw)
  To: Julia Lawall, linux-usb
  Cc: Felipe Balbi, Greg Kroah-Hartman, Johan Hovold, LKML, kernel-janitors

>> @@ -42,10 +42,9 @@ static int emi26_writememory (struct usb_device *dev, int address,
>>  	int result;
>>  	unsigned char *buffer =  kmemdup(data, length, GFP_KERNEL);
>>
>> -	if (!buffer) {
>> -		dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
> 
> I guess the length information would not be so easy to find in the backtrace.

Why do you “guess”?


>> +	if (!buffer)
>>  		return -ENOMEM;
>> -	}

Would we like to achieve another consensus on the data which are provided by
a default Linux allocation failure report?

Regards,
Markus
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-12-06 13:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 12:06 [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory() SF Markus Elfring
2017-12-06 12:06 ` SF Markus Elfring
2017-12-06 12:06 ` [PATCH] " SF Markus Elfring
2017-12-06 12:12 ` Julia Lawall
2017-12-06 12:12   ` Julia Lawall
2017-12-06 12:12   ` [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory( Julia Lawall
2017-12-06 13:18   ` [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory() Dan Carpenter
2017-12-06 13:18     ` Dan Carpenter
2017-12-06 13:18     ` [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory( Dan Carpenter
2017-12-06 13:25   ` [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory() SF Markus Elfring
2017-12-06 13:25     ` SF Markus Elfring
2017-12-06 13:25     ` [PATCH] USB: emi26: Delete an error message for a failed memory allocation in emi26_writememory( SF Markus Elfring

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.