Skip to content

Commit

Permalink
Fix akmd2 failure; Improve char device
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyJiao committed Jan 3, 2012
1 parent fa1d871 commit 5999209
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions drivers/char/agp/generic.c
Expand Up @@ -1123,8 +1123,8 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type)
return -EINVAL;
}

/* AK: could wrap */
if ((pg_start + mem->page_count) > num_entries)
if (((pg_start + mem->page_count) > num_entries) ||
((pg_start + mem->page_count) < pg_start))
return -EINVAL;

j = pg_start;
Expand Down Expand Up @@ -1158,7 +1158,7 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
{
size_t i;
struct agp_bridge_data *bridge;
int mask_type;
int mask_type, num_entries;

bridge = mem->bridge;
if (!bridge)
Expand All @@ -1170,6 +1170,11 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
if (type != mem->type)
return -EINVAL;

num_entries = agp_num_entries();
if (((pg_start + mem->page_count) > num_entries) ||
((pg_start + mem->page_count) < pg_start))
return -EINVAL;

mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
if (mask_type != 0) {
/* The generic routines know nothing of memory types */
Expand Down
4 changes: 2 additions & 2 deletions drivers/i2c/chips/st303_gs.c
Expand Up @@ -46,8 +46,8 @@
static struct workqueue_struct *gs_wq;
static signed short st_sensor_data[3];

#define ST303DLH_I2C_NAME "st_303dlh"
#define ST303DLM_I2C_NAME "st_303dlm"
#define ST303DLH_I2C_NAME "ST303DLH"
#define ST303DLM_I2C_NAME "ST303DLM"

enum
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/accelerometer/gs_st.c
Expand Up @@ -111,7 +111,7 @@ static inline int reg_write(struct gs_data *gs, int reg, uint8_t val)

static int sensor_data[4];
/*adjust device name */
static char st_device_id[] = "st_35de";
static char st_device_id[] = "ST35DE";

int gs_st_data_to_compass(int accel_data [3])
{
Expand Down

0 comments on commit 5999209

Please sign in to comment.