From patchwork Wed Jul 27 19:17:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 9250355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 230166077C for ; Wed, 27 Jul 2016 19:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1461726253 for ; Wed, 27 Jul 2016 19:18:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0952226538; Wed, 27 Jul 2016 19:18:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95AC525223 for ; Wed, 27 Jul 2016 19:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932311AbcG0TSp (ORCPT ); Wed, 27 Jul 2016 15:18:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48106 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758349AbcG0TRo (ORCPT ); Wed, 27 Jul 2016 15:17:44 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C2887DD2A; Wed, 27 Jul 2016 19:17:44 +0000 (UTC) Received: from hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com [10.16.184.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6RJHenu032006; Wed, 27 Jul 2016 15:17:43 -0400 From: Jarod Wilson To: linux-rdma@vger.kernel.org Cc: Jarod Wilson , Yishai Hadas Subject: [PATCH libmlx5 5/6] fix alloc of mlx5_resource table Date: Wed, 27 Jul 2016 15:17:26 -0400 Message-Id: <1469647047-7544-6-git-send-email-jarod@redhat.com> In-Reply-To: <1469647047-7544-1-git-send-email-jarod@redhat.com> References: <1469647047-7544-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 27 Jul 2016 19:17:44 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Defect type: CLANG_WARNING libmlx5-1.2.1/src/mlx5.c:184:33: note: Result of 'calloc' is converted to a pointer of type 'struct mlx5_resource *', which is incompatible with sizeof operand type 'void *' # ctx->uidx_table[tind].table = calloc(MLX5_UIDX_TABLE_MASK + 1, # ^~~~~~ # 182| # 183| if (!ctx->uidx_table[tind].refcnt) { # 184|-> ctx->uidx_table[tind].table = calloc(MLX5_UIDX_TABLE_MASK + 1, # 185| sizeof(void *)); # 186| if (!ctx->uidx_table[tind].table) Use sizeof(struct mlx5_resource *) for calloc size argument instead. CC: Yishai Hadas Signed-off-by: Jarod Wilson --- src/mlx5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlx5.c b/src/mlx5.c index a5f8daf..99221e6 100644 --- a/src/mlx5.c +++ b/src/mlx5.c @@ -182,7 +182,7 @@ int32_t mlx5_store_uidx(struct mlx5_context *ctx, void *rsc) if (!ctx->uidx_table[tind].refcnt) { ctx->uidx_table[tind].table = calloc(MLX5_UIDX_TABLE_MASK + 1, - sizeof(void *)); + sizeof(struct mlx5_resource *)); if (!ctx->uidx_table[tind].table) goto out; }