OSDN Git Service

Bluetooth: fix err_cast.cocci warnings
authorFengguang Wu <fengguang.wu@intel.com>
Sun, 7 Dec 2014 19:04:38 +0000 (03:04 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 9 Dec 2014 07:06:51 +0000 (08:06 +0100)
net/bluetooth/smp.c:2650:9-16: WARNING: ERR_CAST can be used with tfm_aes

Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Generated by: scripts/coccinelle/api/err_cast.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/smp.c

index 3e174f9..0448985 100644 (file)
@@ -2931,7 +2931,7 @@ static struct l2cap_chan *smp_add_cid(struct hci_dev *hdev, u16 cid)
        tfm_aes = crypto_alloc_blkcipher("ecb(aes)", 0, 0);
        if (IS_ERR(tfm_aes)) {
                BT_ERR("Unable to create crypto context");
-               return ERR_PTR(PTR_ERR(tfm_aes));
+               return ERR_CAST(tfm_aes);
        }
 
 create_chan: