Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1408009ybi; Fri, 2 Aug 2019 15:11:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUpmD6nxS1+VzHWaZn4uRq3S2yt8Fg7Rdai1HkZhIyDzuLlT4n9kP+fxaA4WysFhOKdGk2 X-Received: by 2002:a63:f926:: with SMTP id h38mr36633588pgi.80.1564783917228; Fri, 02 Aug 2019 15:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564783917; cv=none; d=google.com; s=arc-20160816; b=izGcBQBjsZEPwkUxVrN3AaApe/Nn5Ri2N7G9C1MGLyMnQYB3lb//GR87OOivedTb+X mIDbiFl3le14gBHol6N2OGwIeMNBi73smL6l9M7YiOWjZGr/GLL7bYNYlHvC9Nsd9qZ2 ghC9TCw5J8zKJeNmU45MWBxNWVQ+f+1paKUUjwcTjAHIJW8O/4dg4ngRWqEeZKTLds7H rnZMlYHfRYSN18qAKwcSEYOmIkvv/EFajlXJIs6dozscWp4r5Aqc4okEpIMyq77h7kBE veHlNCGQLcJyRgd3R1kJM8UGiTWu3nCvm6jxbKM3nyYdzLs8VcPFajONn55SdsCcm3l4 1cpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=byjiNq9HtMcT98CUosHBBSmbXQTSvoTkbqa7rLBdSEY=; b=p4tnZIhm1PXwSF/nYP32oaAhfiQbwm+sfU+F4lNQfBJFjpnBr6B/2CgxVFuTngqbQp 1yp0d5Zm7JCSgFJcAo+tbOTSBYzqhP/0gm29NyBT43bzHg3Xk9PjQufxR1la6dvCTEaZ gtSGP4tu9A1/URJEsCWImTidOxxJow+MJLNAFHQjEMFZ4TjhY1MxEvG9mrFupL2zrssx ymaa/z6cwKWoU6MQoxX7Pi08JMyqyu4/0pdTx6RQxJYRoH3Lhsq6reafjHaks1OanMxK v2TTwU/LMcVs5gyUoPWJ2wpnph3U1bGhl3zKzW9pPELLebYzYLE4jlO97bo1vEGQzWBY Cjjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vZ1r17FM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r190si38064316pfr.102.2019.08.02.15.11.42; Fri, 02 Aug 2019 15:11:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vZ1r17FM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392528AbfHBMKm (ORCPT + 99 others); Fri, 2 Aug 2019 08:10:42 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38878 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388969AbfHBMKl (ORCPT ); Fri, 2 Aug 2019 08:10:41 -0400 Received: by mail-pg1-f195.google.com with SMTP id f5so27165402pgu.5; Fri, 02 Aug 2019 05:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=byjiNq9HtMcT98CUosHBBSmbXQTSvoTkbqa7rLBdSEY=; b=vZ1r17FMnkBg6TQJeK3FPgfRalxF6pjwpN2HDnLQaZdTdIaw1fDZpdu1SsmX6HulAR UDyLa51RZM77/lN8xZ4T03ImABpzGWvAuQYKDQrZ7cqZj85MjpU13QIKky9DI23ov9h4 //EpBTCu5n5lUiI+DU3qYlaXCZLJf4qON1E4gUQgXs7ShcR/Qteq0UdsayYauo1WwPow H23sg9qdFn4ksqSI+dl6H9HHMtUHRFgpxTRqFHYF7M30azerWksy0/NGdFqsCG3WGFbA 0EiZZCboqJiOLVY1idtdGLPicOz90MJ4vxW6M/MJwFX4nEBgdMXLktXBx2v7pnAYl6Or ukcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=byjiNq9HtMcT98CUosHBBSmbXQTSvoTkbqa7rLBdSEY=; b=MPPH1q7IxUceJkwkSBj6k2pjxu0Ooa0bIo3dV8Z96O9zB1bEj/O+WIQGWc5JAMmVcS FZklJ6+eQpQqLOygfNyrF7vxvWrLRb0+fSTynYZXAka/paxgynMJMuZbfTunhonB2vih eXsjQuaBZaeTJZbFiH07R/Cv1xGSQ1Ohux20kl3JaJFbrQod6TXxlT7lA77tHIJ16qqi 2yd/DeiN9xt/aEXmFqSMyx80rMRbRVJFoqpPhnxXO3aBOzR2Ng7ilaD0OlvbRMab9jHs 47L5X+IeAPbvXGLU4wG8TcxQSU3MtMlOteUQGSK+SbtPd4Thq6me50xMQSW0zHQS3KYH cbGw== X-Gm-Message-State: APjAAAWy9JH8lUTt+fo9NxbNVZV7DvO5TpTk4SdZ31J7iNUD/m07563j LK/1UKTOMjePa7C4S+JFdzY= X-Received: by 2002:a62:ac11:: with SMTP id v17mr59470346pfe.236.1564747840855; Fri, 02 Aug 2019 05:10:40 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id g62sm8243541pje.11.2019.08.02.05.10.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 05:10:40 -0700 (PDT) From: Chuhong Yuan Cc: Leon Romanovsky , Saeed Mahameed , "David S . Miller" , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH 0/3] Use refcount_t for refcount Date: Fri, 2 Aug 2019 20:10:35 +0800 Message-Id: <20190802121035.1315-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reference counters are preferred to use refcount_t instead of atomic_t. This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free. First convert the refcount field to refcount_t in mlx5/driver.h. Then convert the uses to refcount_() APIs. Chuhong Yuan (3): mlx5: Use refcount_t for refcount net/mlx5: Use refcount_() APIs IB/mlx5: Use refcount_() APIs drivers/infiniband/hw/mlx5/srq_cmd.c | 6 +++--- drivers/net/ethernet/mellanox/mlx5/core/qp.c | 6 +++--- include/linux/mlx5/driver.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) -- 2.20.1