Skip to content

Commit c89b857

Browse files
committed
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
2 parents 2e34b42 + 663dd6d commit c89b857

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

drivers/base/platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
367367
*
368368
* Returns &struct platform_device pointer on success, or ERR_PTR() on error.
369369
*/
370-
struct platform_device *__init_or_module platform_device_register_resndata(
370+
struct platform_device *platform_device_register_resndata(
371371
struct device *parent,
372372
const char *name, int id,
373373
const struct resource *res, unsigned int num,

drivers/connector/connector.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ static int cn_call_callback(struct sk_buff *skb)
139139
spin_unlock_bh(&dev->cbdev->queue_lock);
140140

141141
if (cbq != NULL) {
142+
err = 0;
142143
cbq->callback(msg, nsp);
143144
kfree_skb(skb);
144145
cn_queue_release_callback(cbq);

drivers/firmware/google/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ menu "Google Firmware Drivers"
1313
config GOOGLE_SMI
1414
tristate "SMI interface for Google platforms"
1515
depends on ACPI && DMI
16+
select EFI
1617
select EFI_VARS
1718
help
1819
Say Y here if you want to enable SMI callbacks for Google

drivers/misc/pti.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ EXPORT_SYMBOL_GPL(pti_request_masterchannel);
317317
* a master, channel ID address
318318
* used to write to PTI HW.
319319
*
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().
321322
*/
322323
void pti_release_masterchannel(struct pti_masterchannel *mc)
323324
{
@@ -475,8 +476,10 @@ static int pti_tty_install(struct tty_driver *driver, struct tty_struct *tty)
475476
else
476477
pti_tty_data->mc = pti_request_masterchannel(2);
477478

478-
if (pti_tty_data->mc == NULL)
479+
if (pti_tty_data->mc == NULL) {
480+
kfree(pti_tty_data);
479481
return -ENXIO;
482+
}
480483
tty->driver_data = pti_tty_data;
481484
}
482485

@@ -495,7 +498,7 @@ static void pti_tty_cleanup(struct tty_struct *tty)
495498
if (pti_tty_data == NULL)
496499
return;
497500
pti_release_masterchannel(pti_tty_data->mc);
498-
kfree(tty->driver_data);
501+
kfree(pti_tty_data);
499502
tty->driver_data = NULL;
500503
}
501504

@@ -581,7 +584,7 @@ static int pti_char_open(struct inode *inode, struct file *filp)
581584
static int pti_char_release(struct inode *inode, struct file *filp)
582585
{
583586
pti_release_masterchannel(filp->private_data);
584-
kfree(filp->private_data);
587+
filp->private_data = NULL;
585588
return 0;
586589
}
587590

drivers/misc/ti-st/st_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ long st_unregister(struct st_proto_s *proto)
605605
pr_debug("%s: %d ", __func__, proto->chnl_id);
606606

607607
st_kim_ref(&st_gdata, 0);
608-
if (proto->chnl_id >= ST_MAX_CHANNELS) {
608+
if (!st_gdata || proto->chnl_id >= ST_MAX_CHANNELS) {
609609
pr_err(" chnl_id %d not supported", proto->chnl_id);
610610
return -EPROTONOSUPPORT;
611611
}

drivers/misc/ti-st/st_kim.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len)
245245
pr_err("invalid action after change remote baud command");
246246
} else {
247247
*ptr = *ptr + sizeof(struct bts_action) +
248-
((struct bts_action *)nxt_action)->size;
248+
((struct bts_action *)cur_action)->size;
249249
*len = *len - (sizeof(struct bts_action) +
250-
((struct bts_action *)nxt_action)->size);
250+
((struct bts_action *)cur_action)->size);
251251
/* warn user on not commenting these in firmware */
252252
pr_warn("skipping the wait event of change remote baud");
253253
}
@@ -604,6 +604,10 @@ void st_kim_ref(struct st_data_s **core_data, int id)
604604
struct kim_data_s *kim_gdata;
605605
/* get kim_gdata reference from platform device */
606606
pdev = st_get_plat_device(id);
607+
if (!pdev) {
608+
*core_data = NULL;
609+
return;
610+
}
607611
kim_gdata = dev_get_drvdata(&pdev->dev);
608612
*core_data = kim_gdata->core_data;
609613
}

include/linux/connector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#define CN_VAL_DRBD 0x1
4545
#define CN_KVP_IDX 0x9 /* HyperV KVP */
4646

47-
#define CN_NETLINK_USERS 9
47+
#define CN_NETLINK_USERS 10 /* Highest index + 1 */
4848

4949
/*
5050
* Maximum connector's message size.

0 commit comments

Comments
 (0)