Skip to content

Commit

Permalink
pata_legacy: bogus clock in opti82c46x_set_piomode()
Browse files Browse the repository at this point in the history
"sysclk" is used as an index into a 4 element array.  My static
checker complains because it can be out of bounds.  From the
context, it looks like there is a right bit shift missing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Dan Carpenter authored and Jeff Garzik committed Apr 3, 2013
1 parent bdfa2e7 commit e0044c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/pata_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static void opti82c46x_set_piomode(struct ata_port *ap, struct ata_device *adev)
u8 sysclk;

/* Get the clock */
sysclk = opti_syscfg(0xAC) & 0xC0; /* BIOS set */
sysclk = (opti_syscfg(0xAC) & 0xC0) >> 6; /* BIOS set */

/* Enter configuration mode */
ioread16(ap->ioaddr.error_addr);
Expand Down

0 comments on commit e0044c9

Please sign in to comment.