mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
9p/xen: Fix end of loop tests for list_for_each_entry
commit 732b33d0dbf17e9483f0b50385bf606f724f50a2 upstream. This patch addresses the following problems: - priv can never be NULL, so this part of the check is useless - if the loop ran through the whole list, priv->client is invalid and it is more appropriate and sufficient to check for the end of list_for_each_entry loop condition. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Harshvardhan Jha <[email protected]> Reviewed-by: Stefano Stabellini <[email protected]> Tested-by: Stefano Stabellini <[email protected]> Cc: <[email protected]> Signed-off-by: Dominique Martinet <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
7d81fcc203
commit
8a964aa6ed
1 changed files with 2 additions and 2 deletions
|
|
@ -138,7 +138,7 @@ static bool p9_xen_write_todo(struct xen_9pfs_dataring *ring, RING_IDX size)
|
|||
|
||||
static int p9_xen_request(struct p9_client *client, struct p9_req_t *p9_req)
|
||||
{
|
||||
struct xen_9pfs_front_priv *priv = NULL;
|
||||
struct xen_9pfs_front_priv *priv;
|
||||
RING_IDX cons, prod, masked_cons, masked_prod;
|
||||
unsigned long flags;
|
||||
u32 size = p9_req->tc.size;
|
||||
|
|
@ -151,7 +151,7 @@ static int p9_xen_request(struct p9_client *client, struct p9_req_t *p9_req)
|
|||
break;
|
||||
}
|
||||
read_unlock(&xen_9pfs_lock);
|
||||
if (!priv || priv->client != client)
|
||||
if (list_entry_is_head(priv, &xen_9pfs_devs, list))
|
||||
return -EINVAL;
|
||||
|
||||
num = p9_req->tc.tag % priv->num_rings;
|
||||
|
|
|
|||
Loading…
Reference in a new issue