From patchwork Fri Aug 3 19:24:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10555433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7096415E9 for ; Fri, 3 Aug 2018 19:24:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 607082BD38 for ; Fri, 3 Aug 2018 19:24:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54CA82BE92; Fri, 3 Aug 2018 19:24:54 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY 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 867B32BD38 for ; Fri, 3 Aug 2018 19:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728477AbeHCVW1 (ORCPT ); Fri, 3 Aug 2018 17:22:27 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:41946 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbeHCVW1 (ORCPT ); Fri, 3 Aug 2018 17:22:27 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w73JOZdS137270; Fri, 3 Aug 2018 19:24:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=jS4yS5ohquLg+8OQdDk7bSutg9M5XzZDcVlt6hKLzyM=; b=EZsdFMLlBiRUHHtklG1ukPoK1bOqPmWyZhgFl+hRveRYp4GtwlqCGigAFSuMudV/cRF8 mSgVmJylunr8hEZQwcfKllhOrp9gfQ4NneNN2/6god9j1k+f6mXdJBhA29uDB2pSrDfR Juf56zv3EmO9+8tLXnR0tYyi70wqtIETir9v15qx5Q4G5AsI7BBu49BjX7D+i/HeKZmd sKZ6TJNc4d+mcYLmvgZNVzP23ktEs2lS+V8Y3clhr0DYN5eoBq953TG2P/LrqQNo+qa6 vGiXaYkWLShXnMAvc1HGVFyNDkMvKq/k7+CNxjQVnCMEuSRLJTUPk2muMxCQ9Ftddmdq VQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2kma043kvr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 03 Aug 2018 19:24:46 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w73JOj8d030374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 3 Aug 2018 19:24:45 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w73JOiDV004853; Fri, 3 Aug 2018 19:24:44 GMT Received: from kili.mountain (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Aug 2018 12:24:37 -0700 Date: Fri, 3 Aug 2018 22:24:31 +0300 From: Dan Carpenter To: Doug Ledford Cc: Jason Gunthorpe , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] RDMA: Fix an uninitialized variable Message-ID: <20180803192431.pmisuz3qwefd45se@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8974 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=784 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030210 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 A couple of the callers assume that ib_post_send() initializes *bad_send_wr. It doesn't look like we can rely on the ->post_send() function to initialize it. For example in the i40iw_post_recv() function and there are some error paths there which don't set it. Here are the static checker warnings for reference: net/sunrpc/xprtrdma/verbs.c:1564 rpcrdma_post_recvs() error: uninitialized symbol 'bad_wr'. net/sunrpc/xprtrdma/svc_rdma_rw.c:350 svc_rdma_post_chunk_ctxt() error: uninitialized symbol 'bad_wr'. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 8caee90e6dee..0ebacbe5019e 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -3389,6 +3389,8 @@ static inline int ib_post_send(struct ib_qp *qp, { const struct ib_send_wr *dummy; + if (bad_send_wr) + *bad_send_wr = NULL; return qp->device->post_send(qp, send_wr, bad_send_wr ? : &dummy); }