]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rxe: Fix an error handling path in rxe_get_mcg()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 22 May 2022 13:25:08 +0000 (15:25 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 24 May 2022 15:55:12 +0000 (12:55 -0300)
commitd267d0505d623a7a732355b3b06b1d08c3ba0ab2
tree6b5699067d0c0e85dd01cb4a82931f0b87c393c2
parentbdbbe1fc54c8bca95758a197316db490610847db
RDMA/rxe: Fix an error handling path in rxe_get_mcg()

The commit in the Fixes tag has shuffled some code.
Now 'mcg_num' is incremented before the kzalloc(). So if the memory
allocation fails, this increment must be undone.

Fixes: 4adc254b7a0d ("RDMA/rxe: Do not call dev_mc_add/del() under a spinlock")
Link: https://lore.kernel.org/r/fe137cd8b1f17593243aa73d59c18ea71ab9ee36.1653225896.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_mcast.c