diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-04-30 13:37:29 -0700 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-04-30 13:37:29 -0700 |
commit | f9221fd80343285514568da6c5dbda0f87109de8 (patch) | |
tree | 3a2f0077ebea9d094bdeedb319c97cb591d51c51 /drivers/i2c/busses/i2c-stu300.c | |
parent | a36d515c7a2dfacebcf41729f6812dbc424ebcf0 (diff) | |
parent | a9743fcdc0eb43d028b71267438076e1b0112ba0 (diff) |
Merge branch 'skip_delete_inode' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2-mark into ocfs2-fixes
Diffstat (limited to 'drivers/i2c/busses/i2c-stu300.c')
-rw-r--r-- | drivers/i2c/busses/i2c-stu300.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index d2728a28a8db..495be451d326 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c @@ -16,6 +16,7 @@ #include <linux/interrupt.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/slab.h> /* the name of this kernel module */ #define NAME "stu300" @@ -497,7 +498,7 @@ static int stu300_set_clk(struct stu300_dev *dev, unsigned long clkrate) int i = 0; /* Locate the apropriate clock setting */ - while (i < ARRAY_SIZE(stu300_clktable) && + while (i < ARRAY_SIZE(stu300_clktable) - 1 && stu300_clktable[i].rate < clkrate) i++; |