diff --git a/[refs] b/[refs] index 1906d99b8858..03fb6b495f31 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1045b03e07d85f3545118510a587035536030c1c +refs/heads/master: 7c6a329e444725f24c02192ac493d8a7cd9fa638 diff --git a/trunk/include/net/netlink.h b/trunk/include/net/netlink.h index 208fe5a38546..18024b8cecb8 100644 --- a/trunk/include/net/netlink.h +++ b/trunk/include/net/netlink.h @@ -702,7 +702,7 @@ static inline int nla_len(const struct nlattr *nla) */ static inline int nla_ok(const struct nlattr *nla, int remaining) { - return remaining >= (int) sizeof(*nla) && + return remaining >= sizeof(*nla) && nla->nla_len >= sizeof(*nla) && nla->nla_len <= remaining; } diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index f5b21cb93699..278a3ace14f6 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -164,6 +164,9 @@ static inline int hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev * { int ret; + if (!test_bit(HCI_UP, &hdev->flags)) + return -ENETDOWN; + /* Serialize all requests */ hci_req_lock(hdev); ret = __hci_request(hdev, req, opt, timeout);