diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/cb710/sgbuf2.c | 2 | ||||
-rw-r--r-- | drivers/misc/ioc4.c | 2 | ||||
-rw-r--r-- | drivers/misc/lkdtm.c | 8 | ||||
-rw-r--r-- | drivers/misc/pti.c | 11 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpnet.c | 6 | ||||
-rw-r--r-- | drivers/misc/ti-st/st_core.c | 2 | ||||
-rw-r--r-- | drivers/misc/ti-st/st_kim.c | 8 |
7 files changed, 27 insertions, 12 deletions
diff --git a/drivers/misc/cb710/sgbuf2.c b/drivers/misc/cb710/sgbuf2.c index d019746551f3..2a40d0efdff5 100644 --- a/drivers/misc/cb710/sgbuf2.c +++ b/drivers/misc/cb710/sgbuf2.c | |||
@@ -47,7 +47,7 @@ static uint32_t sg_dwiter_read_buffer(struct sg_mapping_iter *miter) | |||
47 | 47 | ||
48 | static inline bool needs_unaligned_copy(const void *ptr) | 48 | static inline bool needs_unaligned_copy(const void *ptr) |
49 | { | 49 | { |
50 | #ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS | 50 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS |
51 | return false; | 51 | return false; |
52 | #else | 52 | #else |
53 | return ((ptr - NULL) & 3) != 0; | 53 | return ((ptr - NULL) & 3) != 0; |
diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c index 668d41e594a9..df03dd3bd0e2 100644 --- a/drivers/misc/ioc4.c +++ b/drivers/misc/ioc4.c | |||
@@ -270,7 +270,7 @@ ioc4_variant(struct ioc4_driver_data *idd) | |||
270 | return IOC4_VARIANT_PCI_RT; | 270 | return IOC4_VARIANT_PCI_RT; |
271 | } | 271 | } |
272 | 272 | ||
273 | static void __devinit | 273 | static void |
274 | ioc4_load_modules(struct work_struct *work) | 274 | ioc4_load_modules(struct work_struct *work) |
275 | { | 275 | { |
276 | request_module("sgiioc4"); | 276 | request_module("sgiioc4"); |
diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c index 81d7fa4ec0db..150cd7061b80 100644 --- a/drivers/misc/lkdtm.c +++ b/drivers/misc/lkdtm.c | |||
@@ -120,6 +120,7 @@ static int recur_count = REC_NUM_DEFAULT; | |||
120 | static enum cname cpoint = CN_INVALID; | 120 | static enum cname cpoint = CN_INVALID; |
121 | static enum ctype cptype = CT_NONE; | 121 | static enum ctype cptype = CT_NONE; |
122 | static int count = DEFAULT_COUNT; | 122 | static int count = DEFAULT_COUNT; |
123 | static DEFINE_SPINLOCK(count_lock); | ||
123 | 124 | ||
124 | module_param(recur_count, int, 0644); | 125 | module_param(recur_count, int, 0644); |
125 | MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\ | 126 | MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\ |
@@ -230,11 +231,14 @@ static const char *cp_name_to_str(enum cname name) | |||
230 | static int lkdtm_parse_commandline(void) | 231 | static int lkdtm_parse_commandline(void) |
231 | { | 232 | { |
232 | int i; | 233 | int i; |
234 | unsigned long flags; | ||
233 | 235 | ||
234 | if (cpoint_count < 1 || recur_count < 1) | 236 | if (cpoint_count < 1 || recur_count < 1) |
235 | return -EINVAL; | 237 | return -EINVAL; |
236 | 238 | ||
239 | spin_lock_irqsave(&count_lock, flags); | ||
237 | count = cpoint_count; | 240 | count = cpoint_count; |
241 | spin_unlock_irqrestore(&count_lock, flags); | ||
238 | 242 | ||
239 | /* No special parameters */ | 243 | /* No special parameters */ |
240 | if (!cpoint_type && !cpoint_name) | 244 | if (!cpoint_type && !cpoint_name) |
@@ -349,6 +353,9 @@ static void lkdtm_do_action(enum ctype which) | |||
349 | 353 | ||
350 | static void lkdtm_handler(void) | 354 | static void lkdtm_handler(void) |
351 | { | 355 | { |
356 | unsigned long flags; | ||
357 | |||
358 | spin_lock_irqsave(&count_lock, flags); | ||
352 | count--; | 359 | count--; |
353 | printk(KERN_INFO "lkdtm: Crash point %s of type %s hit, trigger in %d rounds\n", | 360 | printk(KERN_INFO "lkdtm: Crash point %s of type %s hit, trigger in %d rounds\n", |
354 | cp_name_to_str(cpoint), cp_type_to_str(cptype), count); | 361 | cp_name_to_str(cpoint), cp_type_to_str(cptype), count); |
@@ -357,6 +364,7 @@ static void lkdtm_handler(void) | |||
357 | lkdtm_do_action(cptype); | 364 | lkdtm_do_action(cptype); |
358 | count = cpoint_count; | 365 | count = cpoint_count; |
359 | } | 366 | } |
367 | spin_unlock_irqrestore(&count_lock, flags); | ||
360 | } | 368 | } |
361 | 369 | ||
362 | static int lkdtm_register_cpoint(enum cname which) | 370 | static int lkdtm_register_cpoint(enum cname which) |
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c index bb6f9255c17c..374dfcfccd07 100644 --- a/drivers/misc/pti.c +++ b/drivers/misc/pti.c | |||
@@ -317,7 +317,8 @@ EXPORT_SYMBOL_GPL(pti_request_masterchannel); | |||
317 | * a master, channel ID address | 317 | * a master, channel ID address |
318 | * used to write to PTI HW. | 318 | * used to write to PTI HW. |
319 | * | 319 | * |
320 | * @mc: master, channel apeture ID address to be released. | 320 | * @mc: master, channel apeture ID address to be released. This |
321 | * will de-allocate the structure via kfree(). | ||
321 | */ | 322 | */ |
322 | void pti_release_masterchannel(struct pti_masterchannel *mc) | 323 | void pti_release_masterchannel(struct pti_masterchannel *mc) |
323 | { | 324 | { |
@@ -475,8 +476,10 @@ static int pti_tty_install(struct tty_driver *driver, struct tty_struct *tty) | |||
475 | else | 476 | else |
476 | pti_tty_data->mc = pti_request_masterchannel(2); | 477 | pti_tty_data->mc = pti_request_masterchannel(2); |
477 | 478 | ||
478 | if (pti_tty_data->mc == NULL) | 479 | if (pti_tty_data->mc == NULL) { |
480 | kfree(pti_tty_data); | ||
479 | return -ENXIO; | 481 | return -ENXIO; |
482 | } | ||
480 | tty->driver_data = pti_tty_data; | 483 | tty->driver_data = pti_tty_data; |
481 | } | 484 | } |
482 | 485 | ||
@@ -495,7 +498,7 @@ static void pti_tty_cleanup(struct tty_struct *tty) | |||
495 | if (pti_tty_data == NULL) | 498 | if (pti_tty_data == NULL) |
496 | return; | 499 | return; |
497 | pti_release_masterchannel(pti_tty_data->mc); | 500 | pti_release_masterchannel(pti_tty_data->mc); |
498 | kfree(tty->driver_data); | 501 | kfree(pti_tty_data); |
499 | tty->driver_data = NULL; | 502 | tty->driver_data = NULL; |
500 | } | 503 | } |
501 | 504 | ||
@@ -581,7 +584,7 @@ static int pti_char_open(struct inode *inode, struct file *filp) | |||
581 | static int pti_char_release(struct inode *inode, struct file *filp) | 584 | static int pti_char_release(struct inode *inode, struct file *filp) |
582 | { | 585 | { |
583 | pti_release_masterchannel(filp->private_data); | 586 | pti_release_masterchannel(filp->private_data); |
584 | kfree(filp->private_data); | 587 | filp->private_data = NULL; |
585 | return 0; | 588 | return 0; |
586 | } | 589 | } |
587 | 590 | ||
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index ee5109a3cd98..42f067347bc7 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c | |||
@@ -495,14 +495,14 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
495 | } | 495 | } |
496 | } | 496 | } |
497 | 497 | ||
498 | dev->stats.tx_packets++; | ||
499 | dev->stats.tx_bytes += skb->len; | ||
500 | |||
498 | if (atomic_dec_return(&queued_msg->use_count) == 0) { | 501 | if (atomic_dec_return(&queued_msg->use_count) == 0) { |
499 | dev_kfree_skb(skb); | 502 | dev_kfree_skb(skb); |
500 | kfree(queued_msg); | 503 | kfree(queued_msg); |
501 | } | 504 | } |
502 | 505 | ||
503 | dev->stats.tx_packets++; | ||
504 | dev->stats.tx_bytes += skb->len; | ||
505 | |||
506 | return NETDEV_TX_OK; | 506 | return NETDEV_TX_OK; |
507 | } | 507 | } |
508 | 508 | ||
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index f91f82eabda7..54c91ffe4a91 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c | |||
@@ -605,7 +605,7 @@ long st_unregister(struct st_proto_s *proto) | |||
605 | pr_debug("%s: %d ", __func__, proto->chnl_id); | 605 | pr_debug("%s: %d ", __func__, proto->chnl_id); |
606 | 606 | ||
607 | st_kim_ref(&st_gdata, 0); | 607 | st_kim_ref(&st_gdata, 0); |
608 | if (proto->chnl_id >= ST_MAX_CHANNELS) { | 608 | if (!st_gdata || proto->chnl_id >= ST_MAX_CHANNELS) { |
609 | pr_err(" chnl_id %d not supported", proto->chnl_id); | 609 | pr_err(" chnl_id %d not supported", proto->chnl_id); |
610 | return -EPROTONOSUPPORT; | 610 | return -EPROTONOSUPPORT; |
611 | } | 611 | } |
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 5da93ee6f6be..38fd2f04c07e 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c | |||
@@ -245,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len) | |||
245 | pr_err("invalid action after change remote baud command"); | 245 | pr_err("invalid action after change remote baud command"); |
246 | } else { | 246 | } else { |
247 | *ptr = *ptr + sizeof(struct bts_action) + | 247 | *ptr = *ptr + sizeof(struct bts_action) + |
248 | ((struct bts_action *)nxt_action)->size; | 248 | ((struct bts_action *)cur_action)->size; |
249 | *len = *len - (sizeof(struct bts_action) + | 249 | *len = *len - (sizeof(struct bts_action) + |
250 | ((struct bts_action *)nxt_action)->size); | 250 | ((struct bts_action *)cur_action)->size); |
251 | /* warn user on not commenting these in firmware */ | 251 | /* warn user on not commenting these in firmware */ |
252 | pr_warn("skipping the wait event of change remote baud"); | 252 | pr_warn("skipping the wait event of change remote baud"); |
253 | } | 253 | } |
@@ -604,6 +604,10 @@ void st_kim_ref(struct st_data_s **core_data, int id) | |||
604 | struct kim_data_s *kim_gdata; | 604 | struct kim_data_s *kim_gdata; |
605 | /* get kim_gdata reference from platform device */ | 605 | /* get kim_gdata reference from platform device */ |
606 | pdev = st_get_plat_device(id); | 606 | pdev = st_get_plat_device(id); |
607 | if (!pdev) { | ||
608 | *core_data = NULL; | ||
609 | return; | ||
610 | } | ||
607 | kim_gdata = dev_get_drvdata(&pdev->dev); | 611 | kim_gdata = dev_get_drvdata(&pdev->dev); |
608 | *core_data = kim_gdata->core_data; | 612 | *core_data = kim_gdata->core_data; |
609 | } | 613 | } |