* [PATCH v2 0/3] Use refcount_t for refcount
@ 2019-08-02 17:23 Chuhong Yuan
2019-08-04 12:52 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-08-02 17:23 UTC (permalink / raw)
Cc: Saeed Mahameed, Leon Romanovsky, David S . Miller, Doug Ledford,
Jason Gunthorpe, netdev, linux-rdma, linux-kernel, Chuhong Yuan
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.
Changelog:
v1 -> v2:
- Add #include in include/linux/mlx5/driver.h.
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 | 3 ++-
3 files changed, 8 insertions(+), 7 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2 0/3] Use refcount_t for refcount
2019-08-02 17:23 [PATCH v2 0/3] Use refcount_t for refcount Chuhong Yuan
@ 2019-08-04 12:52 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2019-08-04 12:52 UTC (permalink / raw)
To: Chuhong Yuan
Cc: Saeed Mahameed, David S . Miller, Doug Ledford, Jason Gunthorpe,
netdev, linux-rdma, linux-kernel
On Sat, Aug 03, 2019 at 01:23:34AM +0800, Chuhong Yuan wrote:
> 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.
>
> Changelog:
>
> v1 -> v2:
> - Add #include in include/linux/mlx5/driver.h.
The same NAK as for version v0.
Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-04 12:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02 17:23 [PATCH v2 0/3] Use refcount_t for refcount Chuhong Yuan
2019-08-04 12:52 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).