Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490877

[PATCH 2/5] ISDN-CAPI: Delete error messages for a failed memory allocation in four functions

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/5] ISDN-CAPI: Delete error messages for a failed memory allocation in four functions
Date 2016-09-25 13:20 +0200
Message-ID <slfDs-5Uj-19@gated-at.bofh.it> (permalink)
References <slfDr-5Uj-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 25 Sep 2016 11:17:39 +0200

Omit an extra message for a memory allocation failure in a few functions.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/isdn/capi/capidrv.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index cd8e1a6..bb945dd 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -471,7 +471,6 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
 
 	n = kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
 	if (!n) {
-		printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
 		return -1;
 	}
 	n->next = NULL;
@@ -513,7 +512,6 @@ static void send_message(capidrv_contr *card, _cmsg *cmsg)
 	len = CAPIMSG_LEN(cmsg->buf);
 	skb = alloc_skb(len, GFP_ATOMIC);
 	if (!skb) {
-		printk(KERN_ERR "capidrv::send_message: can't allocate mem\n");
 		return;
 	}
 	memcpy(skb_put(skb, len), cmsg->buf, len);
@@ -2111,8 +2109,6 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
 	if (skb_headroom(skb) < msglen) {
 		struct sk_buff *nskb = skb_realloc_headroom(skb, msglen);
 		if (!nskb) {
-			printk(KERN_ERR "capidrv-%d: if_sendbuf: no memory\n",
-			       card->contrnr);
 			(void)capidrv_del_ack(nccip, datahandle);
 			return 0;
 		}
@@ -2259,8 +2255,6 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 		return -1;
 	}
 	if (!(card = kzalloc(sizeof(capidrv_contr), GFP_ATOMIC))) {
-		printk(KERN_WARNING
-		       "capidrv: (%s) Could not allocate contr-struct.\n", id);
 		return -1;
 	}
 	card->owner = THIS_MODULE;
@@ -2272,8 +2266,6 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 				     sizeof(capidrv_bchan),
 				     GFP_ATOMIC);
 	if (!card->bchans) {
-		printk(KERN_WARNING
-		       "capidrv: (%s) Could not allocate bchan-structs.\n", id);
 		module_put(card->owner);
 		kfree(card);
 		return -1;
-- 
2.10.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] ISDN-CAPI: Fine-tuning for several function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-25 13:20 +0200
  [PATCH 3/5] ISDN-CAPI: Adjust 17 function calls together with  variable assignments SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-25 13:20 +0200
    Re: [PATCH 3/5] ISDN-CAPI: Adjust 17 function calls together with  variable assignments Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 11:20 +0200
      Re: ISDN-CAPI: Adjust 17 function calls together with variable  assignments SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 14:40 +0200
  [PATCH 4/5] ISDN-CAPI: Adjust checks for null pointers in four  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-25 13:20 +0200
  [PATCH 2/5] ISDN-CAPI: Delete error messages for a failed memory  allocation in four functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-25 13:20 +0200

csiph-web