[Bluetooth] Kill redundant NULL checks before kfree()

2005-08-06 Thread Linux Kernel Mailing List
tree 6ce4e75810fc0724d05c305fc6b517aba23598c0
parent dcc365d8f28d6a2332fa37e64d669858a8d017e8
author Marcel Holtmann [EMAIL PROTECTED] Sat, 06 Aug 2005 12:36:47 +0200
committer Marcel Holtmann [EMAIL PROTECTED] Sat, 06 Aug 2005 12:36:47 +0200

[Bluetooth] Kill redundant NULL checks before kfree()

There's no need to check for NULL before calling kfree() on a pointer.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]

 drivers/bluetooth/bpa10x.c  |7 ++-
 drivers/bluetooth/hci_usb.c |6 ++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -367,11 +367,8 @@ static inline void bpa10x_free_urb(struc
if (!urb)
return;
 
-   if (urb-setup_packet)
-   kfree(urb-setup_packet);
-
-   if (urb-transfer_buffer)
-   kfree(urb-transfer_buffer);
+   kfree(urb-setup_packet);
+   kfree(urb-transfer_buffer);
 
usb_free_urb(urb);
 }
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -390,10 +390,8 @@ static void hci_usb_unlink_urbs(struct h
urb = _urb-urb;
BT_DBG(%s freeing _urb %p type %d urb %p,
husb-hdev-name, _urb, _urb-type, 
urb);
-   if (urb-setup_packet)
-   kfree(urb-setup_packet);
-   if (urb-transfer_buffer)
-   kfree(urb-transfer_buffer);
+   kfree(urb-setup_packet);
+   kfree(urb-transfer_buffer);
_urb_free(_urb);
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bluetooth] Revert session reference counting fix

2005-08-06 Thread Linux Kernel Mailing List
tree 45872ffc48be8319a88259cfcef86605a1f94a4e
parent cad0f6270c0bae5bcae6af3c7ac7bd3ae5d9b618
author Marcel Holtmann [EMAIL PROTECTED] Sat, 06 Aug 2005 12:36:42 +0200
committer Marcel Holtmann [EMAIL PROTECTED] Sat, 06 Aug 2005 12:36:42 +0200

[Bluetooth] Revert session reference counting fix

The fix for the reference counting problem of the signal DLC introduced
a race condition which leads to an oops. The reason for it is not fully
understood by now and so revert this fix, because the reference counting
problem is not crashing the RFCOMM layer and its appearance it rare.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]

 net/bluetooth/rfcomm/core.c |4 
 1 files changed, 4 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -389,8 +389,6 @@ static int __rfcomm_dlc_close(struct rfc
rfcomm_dlc_unlock(d);
 
skb_queue_purge(d-tx_queue);
-   rfcomm_session_put(s);
-
rfcomm_dlc_unlink(d);
}
 
@@ -600,8 +598,6 @@ static struct rfcomm_session *rfcomm_ses
goto failed;
}
 
-   rfcomm_session_hold(s);
-
s-initiator = 1;
 
bacpy(addr.l2_bdaddr, dst);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bluetooth] Remove unused functions and cleanup symbol exports

2005-08-06 Thread Linux Kernel Mailing List
tree cf25ee6d3b555a246be9bf8b783d3a92325cf5d9
parent e9a3e671c09d419f29710d8620ed916d3bf7d7ab
author Marcel Holtmann [EMAIL PROTECTED] Sat, 06 Aug 2005 12:36:51 +0200
committer Marcel Holtmann [EMAIL PROTECTED] Sat, 06 Aug 2005 12:36:51 +0200

[Bluetooth] Remove unused functions and cleanup symbol exports

This patch removes the unused bt_dump() function and it also removes
its BT_DMP macro. It also unexports the hci_dev_get(), hci_send_cmd()
and hci_si_event() functions.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]

 drivers/bluetooth/hci_bcsp.c  |2 --
 drivers/bluetooth/hci_h4.c|5 -
 drivers/bluetooth/hci_ldisc.c |2 --
 drivers/bluetooth/hci_usb.c   |2 --
 include/net/bluetooth/bluetooth.h |8 
 net/bluetooth/hci_core.c  |2 --
 net/bluetooth/hci_event.c |1 -
 net/bluetooth/lib.c   |   25 -
 8 files changed, 47 deletions(-)

diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -58,8 +58,6 @@
 #ifndef CONFIG_BT_HCIUART_DEBUG
 #undef  BT_DBG
 #define BT_DBG( A... )
-#undef  BT_DMP
-#define BT_DMP( A... )
 #endif
 
 static int hciextn = 1;
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -57,8 +57,6 @@
 #ifndef CONFIG_BT_HCIUART_DEBUG
 #undef  BT_DBG
 #define BT_DBG( A... )
-#undef  BT_DMP
-#define BT_DMP( A... )
 #endif
 
 /* Initialize protocol */
@@ -125,7 +123,6 @@ static inline int h4_check_data_len(stru
 
BT_DBG(len %d room %d, len, room);
if (!len) {
-   BT_DMP(h4-rx_skb-data, h4-rx_skb-len);
hci_recv_frame(h4-rx_skb);
} else if (len  room) {
BT_ERR(Data length is too large);
@@ -169,8 +166,6 @@ static int h4_recv(struct hci_uart *hu, 
case H4_W4_DATA:
BT_DBG(Complete data);
 
-   BT_DMP(h4-rx_skb-data, h4-rx_skb-len);
-
hci_recv_frame(h4-rx_skb);
 
h4-rx_state = H4_W4_PACKET_TYPE;
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -57,8 +57,6 @@
 #ifndef CONFIG_BT_HCIUART_DEBUG
 #undef  BT_DBG
 #define BT_DBG( A... )
-#undef  BT_DMP
-#define BT_DMP( A... )
 #endif
 
 static int reset = 0;
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -57,8 +57,6 @@
 #ifndef CONFIG_BT_HCIUSB_DEBUG
 #undef  BT_DBG
 #define BT_DBG(D...)
-#undef  BT_DMP
-#define BT_DMP(D...)
 #endif
 
 #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET
diff --git a/include/net/bluetooth/bluetooth.h 
b/include/net/bluetooth/bluetooth.h
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -57,12 +57,6 @@
 #define BT_DBG(fmt, arg...)  printk(KERN_INFO %s:  fmt \n , __FUNCTION__ , 
## arg)
 #define BT_ERR(fmt, arg...)  printk(KERN_ERR  %s:  fmt \n , __FUNCTION__ , 
## arg)
 
-#ifdef HCI_DATA_DUMP
-#define BT_DMP(buf, len) bt_dump(__FUNCTION__, buf, len)
-#else
-#define BT_DMP(D...)
-#endif
-
 extern struct proc_dir_entry *proc_bt;
 
 /* Connection and socket states */
@@ -174,8 +168,6 @@ static inline int skb_frags_no(struct sk
return n;
 }
 
-void bt_dump(char *pref, __u8 *buf, int count);
-
 int bt_err(__u16 code);
 
 #endif /* __BLUETOOTH_H */
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -299,7 +299,6 @@ struct hci_dev *hci_dev_get(int index)
read_unlock(hci_dev_list_lock);
return hdev;
 }
-EXPORT_SYMBOL(hci_dev_get);
 
 /*  Inquiry support  */
 static void inquiry_cache_flush(struct hci_dev *hdev)
@@ -1042,7 +1041,6 @@ int hci_send_cmd(struct hci_dev *hdev, _
 
return 0;
 }
-EXPORT_SYMBOL(hci_send_cmd);
 
 /* Get data from the previously sent command */
 void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1040,4 +1040,3 @@ void hci_si_event(struct hci_dev *hdev, 
hci_send_to_sock(hdev, skb);
kfree_skb(skb);
 }
-EXPORT_SYMBOL(hci_si_event);
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -34,31 +34,6 @@
 
 #include net/bluetooth/bluetooth.h
 
-void bt_dump(char *pref, __u8 *buf, int count)
-{
-   char *ptr;
-   char line[100];
-   unsigned int i;
-
-   printk(KERN_INFO %s: dump, len %d\n, pref, count);
-
-   ptr = line;
-   *ptr = 0;
-   for (i = 0; i  count; i++) {
-   ptr += sprintf(ptr,  

ppc: Export __handle_mm_fault for MOL

2005-08-06 Thread Linux Kernel Mailing List
tree cd2d71428286934c89294ad12ebe4928c9425302
parent fab5a60a29f98f17256a4183e34a414f6db67569
author Linus Torvalds [EMAIL PROTECTED] Sat, 06 Aug 2005 23:44:37 -0700
committer Linus Torvalds [EMAIL PROTECTED] Sat, 06 Aug 2005 23:44:37 -0700

ppc: Export __handle_mm_fault for MOL

When we did the handle_mm_fault cleanup and get_user_page() race fixes,
handle_mm_fault turned into an inline function that called the real
__handle_mm_fault() code.  The export needed for MOL on ppc wasn't
updated to match the new world order, though.

Turn it into a GPL export while at it, since this is all about internal
interfaces and MOL is GPL'd anwyay.

 arch/ppc/kernel/ppc_ksyms.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -324,7 +324,7 @@ EXPORT_SYMBOL(__res);
 
 EXPORT_SYMBOL(next_mmu_context);
 EXPORT_SYMBOL(set_context);
-EXPORT_SYMBOL(handle_mm_fault); /* For MOL */
+EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
 EXPORT_SYMBOL(disarm_decr);
 #ifdef CONFIG_PPC_STD_MMU
 extern long mol_trampoline;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Check input buffer size in zisofs

2005-08-06 Thread Linux Kernel Mailing List
tree eff86901dda863299501c6e729a2d621f607314f
parent 243393c90f2b7cb781fd794e22786e9c8547901a
author Linus Torvalds [EMAIL PROTECTED] Sat, 06 Aug 2005 23:42:06 -0700
committer Linus Torvalds [EMAIL PROTECTED] Sat, 06 Aug 2005 23:42:06 -0700

Check input buffer size in zisofs

This uses the new deflateBound() thing to sanity-check the input to the
zlib decompressor before we even bother to start reading in the blocks.

Problem noted by Tim Yamin [EMAIL PROTECTED]

 fs/isofs/compress.c |6 ++
 1 files changed, 6 insertions(+)

diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -129,8 +129,14 @@ static int zisofs_readpage(struct file *
cend = le32_to_cpu(*(__le32 *)(bh-b_data + (blockendptr  bufmask)));
brelse(bh);
 
+   if (cstart  cend)
+   goto eio;
+   
csize = cend-cstart;
 
+   if (csize  deflateBound(1UL  zisofs_block_shift))
+   goto eio;
+
/* Now page[] contains an array of pages, any of which can be NULL,
   and the locks on which we hold.  We should now read the data and
   release the pages.  If the pages are NULL the decompressed data
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] i386 visws: Add machine_shutdown and emergency_restart

2005-08-06 Thread Linux Kernel Mailing List
tree fa988e457ce99f4eb9a85da9daf84951b5fcfe15
parent 094528a7fb3f75a83673e5cc3271fd466f2e278d
author Eric W. Biederman [EMAIL PROTECTED] Sun, 07 Aug 2005 01:45:10 -0600
committer Linus Torvalds [EMAIL PROTECTED] Sun, 07 Aug 2005 02:54:57 -0700

[PATCH] i386 visws: Add machine_shutdown and emergency_restart

Another x86 subarchitecture bit I missed.  This adds both
machine_emergency_restart missed in my reboot fixes and
machine_shutdown needed for kexec support.

Signed-off-by: Linus Torvalds [EMAIL PROTECTED]

 arch/i386/mach-visws/reboot.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -9,12 +9,15 @@
 void (*pm_power_off)(void);
 EXPORT_SYMBOL(pm_power_off);
 
-void machine_restart(char * __unused)
+void machine_shutdown(void)
 {
 #ifdef CONFIG_SMP
smp_send_stop();
 #endif
+}
 
+void machine_emergency_restart(void)
+{
/*
 * Visual Workstations restart after this
 * register is poked on the PIIX4
@@ -22,6 +25,12 @@ void machine_restart(char * __unused)
outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
 }
 
+void machine_restart(char * __unused)
+{
+   machine_shutdown();
+   machine_emergency_restart();
+}
+
 void machine_power_off(void)
 {
unsigned short pm_status;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html