diff mbox

[1/1,net-next] caif_usb: remove redundant memory message

Message ID 1413231946-9914-1-git-send-email-fabf@skynet.be
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Fabian Frederick Oct. 13, 2014, 8:25 p.m. UTC
Let MM subsystem display out of memory messages.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 net/caif/caif_usb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Joe Perches Oct. 13, 2014, 8:34 p.m. UTC | #1
On Mon, 2014-10-13 at 22:25 +0200, Fabian Frederick wrote:
> Let MM subsystem display out of memory messages.
[]
> diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
[]
> @@ -87,10 +87,9 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
>  {
>  	struct cfusbl *this = kmalloc(sizeof(struct cfusbl), GFP_ATOMIC);
>  
> -	if (!this) {
> -		pr_warn("Out of memory\n");
> +	if (!this)
>  		return NULL;
> -	}
> +
>  	caif_assert(offsetof(struct cfusbl, layer) == 0);
>  
>  	memset(this, 0, sizeof(struct cflayer));

This bit should probably be:

	memset(&this->layer, 0, sizeof(this->layer));

or the allocation above should use kzalloc.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
index ba02db0..0e487b0 100644
--- a/net/caif/caif_usb.c
+++ b/net/caif/caif_usb.c
@@ -87,10 +87,9 @@  static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
 {
 	struct cfusbl *this = kmalloc(sizeof(struct cfusbl), GFP_ATOMIC);
 
-	if (!this) {
-		pr_warn("Out of memory\n");
+	if (!this)
 		return NULL;
-	}
+
 	caif_assert(offsetof(struct cfusbl, layer) == 0);
 
 	memset(this, 0, sizeof(struct cflayer));