]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/ocrdma: Fix permissions for OCRDMA_RESET_STATS
authorAnton Vasilyev <vasilyev@ispras.ru>
Tue, 8 Aug 2017 15:56:37 +0000 (18:56 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 21 Dec 2017 02:56:24 +0000 (19:56 -0700)
Debugfs file reset_stats is created with S_IRUSR permissions,
but ocrdma_dbgfs_ops_read() doesn't support OCRDMA_RESET_STATS,
whereas ocrdma_dbgfs_ops_write() supports only OCRDMA_RESET_STATS.

The patch fixes misstype with permissions.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/ocrdma/ocrdma_stats.c

index e528d7acb7f64787c31071ac7f4de8184c70c5a6..fb78b16ce671bda556fb00162abc4eb236ce162b 100644 (file)
@@ -834,7 +834,7 @@ void ocrdma_add_port_stats(struct ocrdma_dev *dev)
 
        dev->reset_stats.type = OCRDMA_RESET_STATS;
        dev->reset_stats.dev = dev;
-       if (!debugfs_create_file("reset_stats", S_IRUSR, dev->dir,
+       if (!debugfs_create_file("reset_stats", 0200, dev->dir,
                                &dev->reset_stats, &ocrdma_dbg_ops))
                goto err;