linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Ryan Ding <ryan.ding@oracle.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	Junxiao Bi <junxiao.bi@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: fs/ocfs2/aops.c:1881:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
Date: Tue, 29 Mar 2016 01:12:38 +0800	[thread overview]
Message-ID: <201603290135.boGSGJFw%fengguang.wu@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f55532a0c0b8bb6148f4e07853b876ef73bc69ca
commit: 4506cfb6f8cad594ac73e0df2b2961ca10dbd25e ocfs2: record UNWRITTEN extents when populate write desc
date:   3 days ago


coccinelle warnings: (new ones prefixed by >>)

>> fs/ocfs2/aops.c:1881:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

vim +1881 fs/ocfs2/aops.c

  1865				ret = -ENOMEM;
  1866				goto out;
  1867			}
  1868			goto retry;
  1869		}
  1870		/* This direct write will doing zero. */
  1871		new->ue_cpos = desc->c_cpos;
  1872		new->ue_phys = desc->c_phys;
  1873		desc->c_clear_unwritten = 0;
  1874		list_add_tail(&new->ue_ip_node, &oi->ip_unwritten_list);
  1875		list_add_tail(&new->ue_node, &wc->w_unwritten_list);
  1876		new = NULL;
  1877	unlock:
  1878		spin_unlock(&oi->ip_lock);
  1879	out:
  1880		if (new)
> 1881			kfree(new);
  1882		return ret;
  1883	}
  1884	
  1885	/*
  1886	 * Populate each single-cluster write descriptor in the write context
  1887	 * with information about the i/o to be done.
  1888	 *
  1889	 * Returns the number of clusters that will have to be allocated, as

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2016-03-28 17:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201603290135.boGSGJFw%fengguang.wu@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=junxiao.bi@oracle.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryan.ding@oracle.com \
    /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