File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
drivers/infiniband/hw/hfi1 Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -12500,7 +12500,8 @@ static int init_cntrs(struct hfi1_devdata *dd)
12500
12500
}
12501
12501
12502
12502
/* allocate space for the counter values */
12503
- dd -> cntrs = kcalloc (dd -> ndevcntrs , sizeof (u64 ), GFP_KERNEL );
12503
+ dd -> cntrs = kcalloc (dd -> ndevcntrs + num_driver_cntrs , sizeof (u64 ),
12504
+ GFP_KERNEL );
12504
12505
if (!dd -> cntrs )
12505
12506
goto bail ;
12506
12507
Original file line number Diff line number Diff line change @@ -155,6 +155,8 @@ struct hfi1_ib_stats {
155
155
extern struct hfi1_ib_stats hfi1_stats ;
156
156
extern const struct pci_error_handlers hfi1_pci_err_handler ;
157
157
158
+ extern int num_driver_cntrs ;
159
+
158
160
/*
159
161
* First-cut criterion for "device is active" is
160
162
* two thousand dwords combined Tx, Rx traffic per
Original file line number Diff line number Diff line change @@ -1479,7 +1479,7 @@ static const char * const driver_cntr_names[] = {
1479
1479
static DEFINE_MUTEX (cntr_names_lock ); /* protects the *_cntr_names bufers */
1480
1480
static const char * * dev_cntr_names ;
1481
1481
static const char * * port_cntr_names ;
1482
- static int num_driver_cntrs = ARRAY_SIZE (driver_cntr_names );
1482
+ int num_driver_cntrs = ARRAY_SIZE (driver_cntr_names );
1483
1483
static int num_dev_cntrs ;
1484
1484
static int num_port_cntrs ;
1485
1485
static int cntr_names_initialized ;
You can’t perform that action at this time.
0 commit comments