aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-28 14:15:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-28 14:15:36 -0400
commitc89b857ce6d803905b2c9d71bc9effdd286c45ed (patch)
tree6cf4a6e23f68f3b65906210dccb272ab2f9c5c74
parent2e34b429a404675dc4fc4ad2ee339eea028da3ca (diff)
parent663dd6dcaf7e95526e469e91f41972a9c0cca30c (diff)
Merge branch 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: Connector: Correctly set the error code in case of success when dispatching receive callbacks Connector: Set the CN_NETLINK_USERS correctly pti: PTI semantics fix in pti_tty_cleanup. pti: ENXIO error case memory leak PTI fix. pti: double-free security PTI fix drivers:misc: ti-st: fix skipping of change remote baud drivers/base/platform.c: don't mark platform_device_register_resndata() as __init_or_module st_kim: Handle case of no device found for ID 0 firmware: fix GOOGLE_SMI kconfig dependency warning
-rw-r--r--drivers/base/platform.c2
-rw-r--r--drivers/connector/connector.c1
-rw-r--r--drivers/firmware/google/Kconfig1
-rw-r--r--drivers/misc/pti.c11
-rw-r--r--drivers/misc/ti-st/st_core.c2
-rw-r--r--drivers/misc/ti-st/st_kim.c8
-rw-r--r--include/linux/connector.h2
7 files changed, 18 insertions, 9 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1c291af637b3..6040717b62bb 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
367 * 367 *
368 * Returns &struct platform_device pointer on success, or ERR_PTR() on error. 368 * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
369 */ 369 */
370struct platform_device *__init_or_module platform_device_register_resndata( 370struct platform_device *platform_device_register_resndata(
371 struct device *parent, 371 struct device *parent,
372 const char *name, int id, 372 const char *name, int id,
373 const struct resource *res, unsigned int num, 373 const struct resource *res, unsigned int num,
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 219d88a0eeae..dde6a0fad408 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -139,6 +139,7 @@ static int cn_call_callback(struct sk_buff *skb)
139 spin_unlock_bh(&dev->cbdev->queue_lock); 139 spin_unlock_bh(&dev->cbdev->queue_lock);
140 140
141 if (cbq != NULL) { 141 if (cbq != NULL) {
142 err = 0;
142 cbq->callback(msg, nsp); 143 cbq->callback(msg, nsp);
143 kfree_skb(skb); 144 kfree_skb(skb);
144 cn_queue_release_callback(cbq); 145 cn_queue_release_callback(cbq);
diff --git a/drivers/firmware/google/Kconfig b/drivers/firmware/google/Kconfig
index 87096b6ca5c9..2f21b0bfe653 100644
--- a/drivers/firmware/google/Kconfig
+++ b/drivers/firmware/google/Kconfig
@@ -13,6 +13,7 @@ menu "Google Firmware Drivers"
13config GOOGLE_SMI 13config GOOGLE_SMI
14 tristate "SMI interface for Google platforms" 14 tristate "SMI interface for Google platforms"
15 depends on ACPI && DMI 15 depends on ACPI && DMI
16 select EFI
16 select EFI_VARS 17 select EFI_VARS
17 help 18 help
18 Say Y here if you want to enable SMI callbacks for Google 19 Say Y here if you want to enable SMI callbacks for Google
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 */
322void pti_release_masterchannel(struct pti_masterchannel *mc) 323void 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)
581static int pti_char_release(struct inode *inode, struct file *filp) 584static 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/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}
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 7c60d0942adb..f696bccd48cb 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -44,7 +44,7 @@
44#define CN_VAL_DRBD 0x1 44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */ 45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46 46
47#define CN_NETLINK_USERS 9 47#define CN_NETLINK_USERS 10 /* Highest index + 1 */
48 48
49/* 49/*
50 * Maximum connector's message size. 50 * Maximum connector's message size.