From acfd4aae9e782bb5b1dde844247cda01e3256cd2 Mon Sep 17 00:00:00 2001 From: Mark Hounschell Date: Fri, 25 Apr 2014 13:10:20 -0400 Subject: [PATCH] staging: dgap: Add check for MAXBOARDS in .probe (dgap_init_one) Insure we don't allow configuring more than MAXBOARDS (32). Signed-off-by: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgap/dgap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index b834c83..f597432 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -572,6 +572,9 @@ static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int rc; + if (dgap_NumBoards >= MAXBOARDS) + return -EPERM; + /* wake up and enable device */ rc = pci_enable_device(pdev); -- 2.7.4