container_of() will never return NULL, so remove useless code. Signed-off-by: Haowen Bai <baihaowen@xxxxxxxxx> --- drivers/infiniband/sw/rdmavt/vt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c index 59481ae39505..b2d83b4958fc 100644 --- a/drivers/infiniband/sw/rdmavt/vt.c +++ b/drivers/infiniband/sw/rdmavt/vt.c @@ -50,8 +50,6 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports) struct rvt_dev_info *rdi; rdi = container_of(_ib_alloc_device(size), struct rvt_dev_info, ibdev); - if (!rdi) - return rdi; rdi->ports = kcalloc(nports, sizeof(*rdi->ports), GFP_KERNEL); if (!rdi->ports) -- 2.7.4