Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2105414rwd; Wed, 17 May 2023 06:00:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61N10m0JR3xW3n6b/vrVstjoNEmfYVREjpVxnjqHGY3gKNr1spOyOgCni6dfWhT1ri6Xr2 X-Received: by 2002:a17:902:ced1:b0:1ac:5def:d203 with SMTP id d17-20020a170902ced100b001ac5defd203mr46613960plg.35.1684328404018; Wed, 17 May 2023 06:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684328404; cv=none; d=google.com; s=arc-20160816; b=CYffTM6Q+aulpnNbrgR9TKrG+QIoJaqmDVHuEUjdlRI0hQscJ3CkH33rJiCFXVyJS3 IqQ28SeRzmPRix0zNKDjz52xQQ0bTACb9RTpswxkDWjKetVFCsSoLHpNEuGKbzZu4HIr 4VeoPmbgyrxmH5rNpLx1B1lPn82170k8C3ga4Md1oKSdVwFamsjLQRv7QNgtu1GPePMh jQaVs9K6nSkHx+vt/Y7CTpfXo0QpKVaFNcqY6ScNTZvTT12O1AogPAjItvlQ/5qoL0sH FrhqbCpCEjwu2dAN/uQoFxDwKg+1zKAyi/I/oA4azh0AdXb/+MsGGmRlvrPnRmVHtM8W bOsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=h7k7IjaeYzyFxPTC4mEC6bmcyhUzoxN00mMqNdxUGSg=; b=e8tJI2c7I07J5A2FYweafCRD6L4qlSMunAxi+PbDuJvsZKi+RslCeT4QoiyLZryPom jsBb+DYz+jUPX/UkumFqEyPU9GMEIKoBkTo17FBRTkR8AKUeZ751ljpYKima6xBQzHkN oIRU84R31TVGNMMMQ/7G32zhn93zU1hopUX2qPwV9Fa8MMJd4cj3/blBiCGqUvH22ulr 4UZeMNx8NOJ7oOzXSTtr8+E5p5CW56RWnpikowKAFJiOXV7znR5kF5JiDY+QIOwTEdQK 05B3RBxcxhahgvspBkSq967joC0l6v/bYg+ILQGOlvwWl9SguWKOyM3YYuKm2zqTZ0B6 rS1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b="g/OEql6t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a170902ba9000b0019931c82e24si20226152pls.195.2023.05.17.05.59.51; Wed, 17 May 2023 06:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b="g/OEql6t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231736AbjEQMu5 (ORCPT + 99 others); Wed, 17 May 2023 08:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbjEQMu5 (ORCPT ); Wed, 17 May 2023 08:50:57 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D68212C for ; Wed, 17 May 2023 05:50:55 -0700 (PDT) Received: from vefanov-Precision-3650-Tower.intra.ispras.ru (unknown [10.10.2.69]) by mail.ispras.ru (Postfix) with ESMTPSA id 0353344C1013; Wed, 17 May 2023 12:50:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 0353344C1013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1684327853; bh=h7k7IjaeYzyFxPTC4mEC6bmcyhUzoxN00mMqNdxUGSg=; h=From:To:Cc:Subject:Date:From; b=g/OEql6tAg1SqO9kI1+t20szxBfxViphCwy3mz7i3B140ti2ATwHc2mWV0Yp1oGCZ za6d57Ot4FcIBxKvfX0EVJoMVNPMiAvFeuGXuma6N4jDhmZrm9kn/K6kFMVvCS+QD7 jOwK74VugpXgOdKg0mk8PYvXCdojEDnQWh5RAiEE= From: Vladislav Efanov To: William Breathitt Gray Cc: Vladislav Efanov , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rene Herman , linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] isa: Remove unnecessary checks Date: Wed, 17 May 2023 15:50:25 +0300 Message-Id: <20230517125025.434005-1-VEfanov@ispras.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The isa_dev->dev.platform_data is initialized with incoming parameter isa_driver. After it isa_dev->dev.platform_data is checked for NULL, but incoming parameter isa_driver is not NULL since it is dereferenced many times before this check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: a5117ba7da37 ("[PATCH] Driver model: add ISA bus") Signed-off-by: Vladislav Efanov --- drivers/base/isa.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/base/isa.c b/drivers/base/isa.c index 55e3ee2da98f..675ad3139224 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -149,11 +149,8 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev) break; } - if (isa_dev->dev.platform_data) { - isa_dev->next = isa_driver->devices; - isa_driver->devices = &isa_dev->dev; - } else - device_unregister(&isa_dev->dev); + isa_dev->next = isa_driver->devices; + isa_driver->devices = &isa_dev->dev; } if (!error && !isa_driver->devices) -- 2.34.1