]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rtrs-srv: Set .release function for rtrs srv device during device init
authorMd Haris Iqbal <haris.iqbal@cloud.ionos.com>
Mon, 7 Sep 2020 10:22:16 +0000 (15:52 +0530)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 9 Sep 2020 16:28:14 +0000 (13:28 -0300)
commitecf61d130cff4199a5f3693d9d364d8a50e4c78f
treecb79db5399343e6f58b8ebd86213f795dcbc106a
parent223d16d87efc0a35cd0f62b7991cf28c78fb856f
RDMA/rtrs-srv: Set .release function for rtrs srv device during device init

The device .release function was not being set during the device
initialization. This was leading to the below warning, in error cases when
put_srv was called before device_add was called.

Warning:

Device '(null)' does not have a release() function, it is broken and must
be fixed. See Documentation/kobject.txt.

So, set the device .release function during device initialization in the
__alloc_srv() function.

Fixes: 5ed32131988a ("RDMA/rtrs-srv: Replace device_register with device_initialize and device_add")
Link: https://lore.kernel.org/r/20200907102216.104041-1-haris.iqbal@cloud.ionos.com
Signed-off-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
drivers/infiniband/ulp/rtrs/rtrs-srv.c