cxgb4: always query device before initializing chip version
PATCH 1/1 cxgb4: always query device before initializing chip version
chip_version may be initialized wrongly if alloc_context() is invoked multiple times. therefore always query device to derive the correct chip_version.
Fixes c7e71b250268 ("cxgb4: fix chipversion initialization")
Signed-off-by Rahul Kundu <[email protected]>
Signed-off-by Potnuri Bharat Teja <[email protected]>
--- providers/cxgb4/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
providers/cxgb4/dev.c +4 -4
@@ -143,14 +143,14 @@ static struct verbs_context *c4iw_alloc_context(struct ibv_device *ibdev, }verbs_set_ops (&context->ibv_ctx, &c4iw_ctx_common_ops); + ret =ibv_cmd_query_device (&context->ibv_ctx.context, &attr, + &raw_fw_ver, &qcmd,sizeof (qcmd)); +if (ret) + goto err_unmap;if (!rhp->mmid2ptr) {int ret; - ret =ibv_cmd_query_device (&context->ibv_ctx.context, &attr, - &raw_fw_ver, &qcmd,sizeof (qcmd)); -if (ret) - goto err_unmap; rhp->max_mr = attr.max_mr; rhp->mmid2ptr =calloc (attr.max_mr,sizeof (void *));if (!rhp->mmid2ptr) {
Signature · 1 line
2.3.9
Leon Romanovsky
AppliedQuoted 11 lines · Potnuri Bharat Teja
chip_versionmay be initialized wrongly ifalloc_context()is invoked multiple times. therefore always query device to derive the correctchip_version.Fixes c7e71b250268 ("cxgb4: fix chipversion initialization")Signed-off-by Rahul Kundu <[email protected]>Signed-off-by Potnuri Bharat Teja <[email protected]>--- providers/cxgb4/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Thanks, applied.