Skip to content

Commit

Permalink
sound: oss/pas2: Fix possible access out of array
Browse files Browse the repository at this point in the history
Added a fix for hardware dependence bug where a sound card failure
should not result in reading beyond array memory index.

Signed-off-by: Asim Kadav <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Asim Kadav authored and tiwai committed Jan 4, 2013
1 parent b7b435e commit dc30a43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/oss/pas2_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config)
{
char temp[100];

if (pas_model < 0 ||
pas_model >= ARRAY_SIZE(pas_model_names)) {
printk(KERN_ERR "pas2 unrecognized model.\n");
return;
}
sprintf(temp,
"%s rev %d", pas_model_names[(int) pas_model],
pas_read(0x2789));
Expand Down

0 comments on commit dc30a43

Please sign in to comment.