diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 0e2a5e144cfe..dc5a138d8d4a 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1965,7 +1965,7 @@ static void neo_vpd(struct dgnc_board *brd) } else { /* Search for the serial number */ - for (i = 0; i < NEO_VPD_IMAGESIZE * 2; i++) { + for (i = 0; i < NEO_VPD_IMAGEBYTES - 3; i++) { if (brd->vpd[i] == 'S' && brd->vpd[i + 1] == 'N') { strncpy(brd->serial_num, &(brd->vpd[i + 3]), 9); }