From patchwork Sat Jan 19 12:56:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 2006691 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B32BA3FE81 for ; Sat, 19 Jan 2013 12:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355Ab3ASM46 (ORCPT ); Sat, 19 Jan 2013 07:56:58 -0500 Received: from mail.ispras.ru ([83.149.199.43]:36184 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319Ab3ASM45 (ORCPT ); Sat, 19 Jan 2013 07:56:57 -0500 Received: from localhost.localdomain (ppp91-79-141-56.pppoe.mtu-net.ru [91.79.141.56]) by mail.ispras.ru (Postfix) with ESMTP id 94E1424FE04; Sat, 19 Jan 2013 16:56:54 +0400 (MSK) From: Alexey Khoroshilov To: Stanislaw Gruszka Cc: Alexey Khoroshilov , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ilw@linux.intel.com, ldv-project@linuxtesting.org Subject: [PATCH] iwlegacy: don't return zero on failure paths in il4965_pci_probe() Date: Sat, 19 Jan 2013 16:56:34 +0400 Message-Id: <1358600194-20371-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If hardware is not ready, il4965_pci_probe() breaks off initialization, deallocates all resources, but returns zero. The patch adds -EIO as return value in this case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/iwlegacy/4965-mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index c3fbf67..c805108 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c @@ -6553,6 +6553,7 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) il4965_prepare_card_hw(il); if (!il->hw_ready) { IL_WARN("Failed, HW not ready\n"); + err = -EIO; goto out_iounmap; }