]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ib_core: initialize shpd field when allocating 'struct ib_pd'
authorMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 20 Feb 2019 19:10:04 +0000 (11:10 -0800)
committerBrian Maly <brian.maly@oracle.com>
Fri, 29 Mar 2019 19:33:48 +0000 (15:33 -0400)
commite7c19601874a83e2cbda63f8b5baad26d8bd93a2
treef90c0e6956461a78eef7ef1b7487abfa50342933
parentb713fa6eebeb17a407a356737b56280720cff1c6
ib_core: initialize shpd field when allocating 'struct ib_pd'

The shared pd feature in Oracle Linux was added by
commit a1911c2c180d ("IB/Shared PD support from Oracle").
It adds a field named shpd to 'struct ib_pd' but fails to
initialize it in all the places it is allocated.

This results its uninitialized content being referenced
in mlx4_ib_dealloc_pd() and actions taken based on it
which eventually leads to resource leaks even when shared
pd feature is not being used.

This fix here initializes it to NULL in ib_alloc_pd() where
the ib_core module allocates the data structure.

Orabug: 29384815

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
Reviewed-by: Rama Nichanamatlu <rama.nichanamatlu@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/infiniband/core/verbs.c