From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-wireless@vger.kernel.org,
Aloisio Almeida Jr <aloisio.almeida@openbossa.org>,
Lauro Ramos Venancio <lauro.venancio@openbossa.org>,
Samuel Ortiz <sameo@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 1/3] NFC-mei_phy: Refactoring for mei_nfc_connect()
Date: Sat, 2 Jan 2016 21:54:35 +0100 [thread overview]
Message-ID: <5688390B.3080800@users.sourceforge.net> (raw)
In-Reply-To: <56883849.2080304@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 2 Jan 2016 21:21:24 +0100
This issue was detected by using the Coccinelle software.
Adjust jump targets according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/nfc/mei_phy.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c
index 83deda4..8e3a69f 100644
--- a/drivers/nfc/mei_phy.c
+++ b/drivers/nfc/mei_phy.c
@@ -173,8 +173,8 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy)
reply = kzalloc(connect_resp_length, GFP_KERNEL);
if (!reply) {
- kfree(cmd);
- return -ENOMEM;
+ r = -ENOMEM;
+ goto free_cmd;
}
connect_resp = (struct mei_nfc_connect_resp *)reply->data;
@@ -189,7 +189,7 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy)
r = mei_cldev_send(phy->cldev, (u8 *)cmd, connect_length);
if (r < 0) {
pr_err("Could not send connect cmd %d\n", r);
- goto err;
+ goto free_reply;
}
bytes_recv = mei_cldev_recv(phy->cldev, (u8 *)reply,
@@ -197,7 +197,7 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy)
if (bytes_recv < 0) {
r = bytes_recv;
pr_err("Could not read connect response %d\n", r);
- goto err;
+ goto free_reply;
}
MEI_DUMP_NFC_HDR("connect reply", &reply->hdr);
@@ -210,11 +210,10 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy)
connect_resp->me_hotfix, connect_resp->me_build);
r = 0;
-
-err:
+free_reply:
kfree(reply);
+free_cmd:
kfree(cmd);
-
return r;
}
--
2.6.3
next prev parent reply other threads:[~2016-01-02 20:54 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <566ABCD9.1060404@users.sourceforge.net>
2016-01-01 18:21 ` [PATCH 0/2] net-ath9k_htc: Fine-tuning for two function implementations SF Markus Elfring
2016-01-01 18:23 ` [PATCH 1/2] net-ath9k_htc: Delete an unnecessary variable initialisation in ath9k_hif_usb_rx_stream() SF Markus Elfring
2016-01-01 19:14 ` Oleksij Rempel
2016-01-01 18:25 ` [PATCH 2/2] net-ath9k_htc: Replace a variable initialisation by an assignment in ath9k_htc_set_channel() SF Markus Elfring
2016-01-01 19:14 ` Oleksij Rempel
2016-04-08 1:40 ` Julian Calaby
2016-04-15 12:09 ` Kalle Valo
2016-04-15 14:34 ` Julian Calaby
2016-04-19 16:13 ` Kalle Valo
2016-01-01 19:26 ` [PATCH] net-brcmfmac: Delete an unnecessary variable initialisation in brcmf_sdio_download_firmware() SF Markus Elfring
2016-01-02 8:50 ` Arend van Spriel
2016-01-14 6:58 ` Kalle Valo
2016-01-01 20:27 ` [PATCH 0/3] net-iwlegacy: Fine-tuning for il_eeprom_init() SF Markus Elfring
2016-01-01 20:30 ` [PATCH 1/3] net-iwlegacy: Refactoring " SF Markus Elfring
2016-01-04 9:33 ` Stanislaw Gruszka
2016-01-01 20:31 ` [PATCH 2/3] net-iwlegacy: One check less in il_eeprom_init() after error detection SF Markus Elfring
2016-01-01 23:13 ` Sergei Shtylyov
2016-01-01 20:32 ` [PATCH 3/3] net-iwlegacy: Another refactoring for il_eeprom_init() SF Markus Elfring
2016-01-02 18:18 ` Souptick Joarder
2016-01-01 21:33 ` [PATCH] net-libertas: Better exception handling in if_spi_host_to_card_worker() SF Markus Elfring
2016-01-01 21:41 ` Julia Lawall
2016-01-01 23:14 ` Sergei Shtylyov
2016-01-02 8:09 ` SF Markus Elfring
2016-01-02 8:21 ` Julia Lawall
2016-01-02 9:08 ` SF Markus Elfring
2016-01-02 10:13 ` Arend van Spriel
2016-01-02 11:21 ` SF Markus Elfring
2016-01-03 9:36 ` Arend van Spriel
2016-01-03 12:13 ` SF Markus Elfring
2016-01-03 15:18 ` Rafał Miłecki
2016-01-04 10:05 ` Arend van Spriel
2016-01-04 11:18 ` Rafał Miłecki
2016-01-21 15:07 ` [PATCH] " Kalle Valo
2016-01-02 14:40 ` [PATCH 0/3] net-rsi: Fine-tuning for two function implementations SF Markus Elfring
2016-01-02 14:43 ` [PATCH 1/3] rsi: Delete unnecessary variable initialisations in rsi_send_mgmt_pkt() SF Markus Elfring
2016-01-02 15:12 ` net-rsi: Reconsider usage of variable "vap_id" " SF Markus Elfring
2016-01-02 16:32 ` [PATCH 1/3] rsi: Delete unnecessary variable initialisations " kbuild test robot
2016-01-02 18:27 ` [PATCH v2 " SF Markus Elfring
2016-01-04 9:28 ` [PATCH " Dan Carpenter
2016-01-04 9:38 ` Dan Carpenter
2016-01-04 10:44 ` SF Markus Elfring
2016-01-04 11:48 ` Dan Carpenter
2016-01-04 12:33 ` SF Markus Elfring
2016-01-04 23:54 ` Julian Calaby
2016-01-05 8:29 ` SF Markus Elfring
2016-01-05 9:47 ` Julian Calaby
2016-01-05 16:23 ` SF Markus Elfring
2016-01-04 13:17 ` [PATCH 1/3] " Bjørn Mork
2016-01-04 14:25 ` Dan Carpenter
2016-01-04 17:14 ` David Miller
2016-01-02 14:44 ` [PATCH 2/3] rsi: Delete unnecessary variable initialisations in rsi_send_data_pkt() SF Markus Elfring
2016-01-02 14:45 ` [PATCH 3/3] rsi: Replace variable initialisations by assignments " SF Markus Elfring
2016-01-02 15:07 ` Francois Romieu
2016-01-15 13:04 ` [PATCH v3 0/3] net-rsi: Fine-tuning for two function implementations SF Markus Elfring
2016-01-15 13:09 ` [PATCH v3 1/3] rsi: Delete unnecessary variable initialisations in rsi_send_mgmt_pkt() SF Markus Elfring
2016-01-15 13:10 ` [PATCH v3 2/3] rsi: Delete unnecessary variable initialisations in rsi_send_data_pkt() SF Markus Elfring
2016-01-15 13:12 ` [PATCH v3 3/3] rsi: Replace variable initialisations by assignments " SF Markus Elfring
2016-01-19 12:40 ` Dan Carpenter
2016-01-02 20:51 ` [PATCH 0/3] NFC-mei_phy: Fine-tuning for two function implementations SF Markus Elfring
2016-01-02 20:54 ` SF Markus Elfring [this message]
2016-01-02 23:41 ` [PATCH 1/3] NFC-mei_phy: Refactoring for mei_nfc_connect() Julian Calaby
2016-01-03 7:00 ` SF Markus Elfring
2016-01-03 7:29 ` Joe Perches
2016-01-02 20:55 ` [PATCH 2/3] NFC-mei_phy: Refactoring for mei_nfc_if_version() SF Markus Elfring
2016-01-02 20:56 ` [PATCH 3/3] NFC-mei_phy: Delete an unnecessary variable initialisation in mei_nfc_if_version() SF Markus Elfring
2016-08-20 16:43 ` [PATCH 0/3] hostap: Fine-tuning for a few functions SF Markus Elfring
2016-08-20 16:45 ` [PATCH 1/3] hostap: Use memdup_user() rather than duplicating its implementation SF Markus Elfring
2016-09-26 14:19 ` [1/3] " Kalle Valo
2016-08-20 16:46 ` [PATCH 2/3] hostap: Delete an unnecessary jump label in prism2_ioctl_priv_hostapd() SF Markus Elfring
2016-08-21 1:45 ` Julian Calaby
2016-09-26 15:06 ` [2/3] " Kalle Valo
[not found] ` <20160926150656.213D961568@smtp.codeaurora.org>
2016-09-26 16:03 ` SF Markus Elfring
2016-09-26 18:01 ` Kalle Valo
2016-09-26 18:06 ` SF Markus Elfring
2016-09-26 18:18 ` Joe Perches
2016-09-26 18:37 ` Kalle Valo
2016-09-26 18:43 ` Joe Perches
2016-08-20 16:48 ` [PATCH 3/3] hostap: Delete unnecessary initialisations for the variable "ret" SF Markus Elfring
2016-08-20 19:26 ` [PATCH 0/3] hostap: Fine-tuning for a few functions Arend van Spriel
2016-08-22 15:49 ` Kalle Valo
2016-08-22 16:18 ` Joe Perches
2016-08-22 18:17 ` [PATCH] checkpatch: See if modified files are marked obsolete in MAINTAINERS Joe Perches
2016-08-22 20:50 ` SF Markus Elfring
2016-08-22 20:56 ` Joe Perches
2016-08-23 7:26 ` SF Markus Elfring
2016-08-23 10:18 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5688390B.3080800@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=aloisio.almeida@openbossa.org \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=lauro.venancio@openbossa.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).