Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc323b2a authored by Ralph Campbell's avatar Ralph Campbell Committed by Roland Dreier
Browse files

IB/qib: Avoid variable-length array



Rather than use a variable size array allocation on the stack,
define a constant for the maximum array size possible.

Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 589643be
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -326,6 +326,9 @@ struct qib_verbs_txreq {

#define QIB_DEFAULT_MTU 4096

/* max number of IB ports supported per HCA */
#define QIB_MAX_IB_PORTS 2

/*
 * Possible IB config parameters for f_get/set_ib_table()
 */
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ static int find_ctxt(struct qib_devdata *dd, unsigned bufn)
void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask,
			    unsigned cnt)
{
	struct qib_pportdata *ppd, *pppd[dd->num_pports];
	struct qib_pportdata *ppd, *pppd[QIB_MAX_IB_PORTS];
	unsigned i;
	unsigned long flags;