Skip to content

Commit acfd4aa

Browse files
Mark Hounschellgregkh
authored andcommitted
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 <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5c3b48d commit acfd4aa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/staging/dgap/dgap.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,9 @@ static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
572572
{
573573
int rc;
574574

575+
if (dgap_NumBoards >= MAXBOARDS)
576+
return -EPERM;
577+
575578
/* wake up and enable device */
576579
rc = pci_enable_device(pdev);
577580

0 commit comments

Comments
 (0)