From: Mark Hounschell Date: Fri, 25 Apr 2014 17:10:20 +0000 (-0400) Subject: staging: dgap: Add check for MAXBOARDS in .probe (dgap_init_one) X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=acfd4aae9e782bb5b1dde844247cda01e3256cd2;p=linux-beck.git 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 --- diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index b834c83da930..f597432ede8c 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);