kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: baspeters93@gmail.com (Bas Peters)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Question on checpatch.pl warning -- possible unnecessary 'out of memory' message.
Date: Wed, 31 Dec 2014 14:38:52 +0100	[thread overview]
Message-ID: <20141231133852.GB24068@gmail.com> (raw)

Dear all,

I'm fixing up my first driver (drivers/isdn/gigaset) to get some
experience submitting patches. When I run checkpatch.pl on some of the
code, I get the following warning:
	
./drivers/isdn/gigaset/capi.c:337: WARNING: Possible unnecessary 'out of memory' message

The corresponding code is:

        cskb = alloc_skb(CAPI_DATA_B3_CONF_LEN, GFP_ATOMIC);
	        if (!cskb) {
		                dev_err(cs->dev, "%s: out of memory\n",
				__func__);
				                return;
			}

All instances of this warning refer to usage of alloc_skb using the
GFP_ATOMIC flag. Why does checkpatch show this warning? Is it not good
practice to _always_ check whether allocation succeeded or not?

I hope someone can explain the nature of this warning and, if right,
what it should look like.

With kind regards,

Bas Peters

             reply	other threads:[~2014-12-31 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-31 13:38 Bas Peters [this message]
2014-12-31 19:37 ` Question on checpatch.pl warning -- possible unnecessary 'out of memory' message Bruno Guedes Souto
2015-01-05  9:49 ` Leon Romanovsky

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=20141231133852.GB24068@gmail.com \
    --to=baspeters93@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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;
as well as URLs for NNTP newsgroup(s).