From patchwork Tue May 7 12:07:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2532931 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1942CDF215 for ; Tue, 7 May 2013 12:07:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757968Ab3EGMHy (ORCPT ); Tue, 7 May 2013 08:07:54 -0400 Received: from mail-bk0-f42.google.com ([209.85.214.42]:35580 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757320Ab3EGMHx (ORCPT ); Tue, 7 May 2013 08:07:53 -0400 Received: by mail-bk0-f42.google.com with SMTP id j4so249676bkw.1 for ; Tue, 07 May 2013 05:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=eXkJGlOxuVpXYk4PQHmPUQXPmvBN5mYgVHrcC2JBoi8=; b=w/2ew3WEHx/lfQ99PmV2q7FGtPEDu1hUsU6QN2CVJxHu+qGk6i7302+RnjPUDhHHic izcwcRa6mNvYhXJvnUto+hadbZPnYyaVYfLS92hj3U+7tk1Z1nweIkpON72jRkzUUJmu SIAxpmtNHMXEQ/bh8qIsxFDoowmP9uQ6JWTEb7pYtOFQGNTV1Phf/zgDslut2CvgsdqR d6ueOBsU3KPiwaAwezl9fWTW+RHSq8vfmSfCPbtPQ/KVD7WLGZnr5+45Dxv/bii5pLoc 2URx+k4yxqiyoUnoW+PqGkhjFBa0QKArEUdk57NhnL3QwwNgCzCsZk87prf2sN1ZSmDu 6wVg== MIME-Version: 1.0 X-Received: by 10.204.173.9 with SMTP id n9mr492646bkz.47.1367928472532; Tue, 07 May 2013 05:07:52 -0700 (PDT) Received: by 10.204.199.129 with HTTP; Tue, 7 May 2013 05:07:52 -0700 (PDT) Date: Tue, 7 May 2013 20:07:52 +0800 Message-ID: Subject: [PATCH] NFC: pn533: fix error return code in pn533_probe() From: Wei Yongjun To: lauro.venancio@openbossa.org, aloisio.almeida@openbossa.org, sameo@linux.intel.com Cc: yongjun_wei@trendmicro.com.cn, linux-wireless@vger.kernel.org, linux-nfc@lists.01.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wei Yongjun Fix to return -ENOMEM in the nfc device alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/nfc/pn533.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index 8f6f2ba..0bdfa88 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c @@ -2783,8 +2783,10 @@ static int pn533_probe(struct usb_interface *interface, dev->ops->tx_header_len + PN533_CMD_DATAEXCH_HEAD_LEN, dev->ops->tx_tail_len); - if (!dev->nfc_dev) + if (!dev->nfc_dev) { + rc = -ENOMEM; goto destroy_wq; + } nfc_set_parent_dev(dev->nfc_dev, &interface->dev); nfc_set_drvdata(dev->nfc_dev, dev);