Skip to content

Commit

Permalink
IB/core: Fix oops in ib_cache_gid_set_default_gid
Browse files Browse the repository at this point in the history
When we fail to find the default gid index, we can't continue
processing in this routine or else we will pass a negative
index to later routines resulting in invalid memory access
attempts and a kernel oops.

Fixes: 03db3a2 (IB/core: Add RoCE GID table management)
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
dledford committed Apr 23, 2016
1 parent 5f44abd commit d29c9ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/core/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,8 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port,
NULL);

/* Coudn't find default GID location */
WARN_ON(ix < 0);
if (WARN_ON(ix < 0))
goto release;

zattr_type.gid_type = gid_type;

Expand Down

0 comments on commit d29c9ab

Please sign in to comment.