Commit dd070a56 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

fs: dlm: use list_first_entry_or_null

Instead of check on list_empty() we can do the same with
list_first_entry_or_null() and return NULL if the returned value is NULL.
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 01ea3d77
......@@ -214,15 +214,12 @@ static struct writequeue_entry *con_next_wq(struct connection *con)
{
struct writequeue_entry *e;
if (list_empty(&con->writequeue))
return NULL;
e = list_first_entry(&con->writequeue, struct writequeue_entry,
list);
e = list_first_entry_or_null(&con->writequeue, struct writequeue_entry,
list);
/* if len is zero nothing is to send, if there are users filling
* buffers we wait until the users are done so we can send more.
*/
if (e->users || e->len == 0)
if (!e || e->users || e->len == 0)
return NULL;
return e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment