Unverified Commit 866c3f30 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13147 CVE-2022-48953

Merge Pull Request from: @ci-robot 
 
PR sync from: Heyuan Wang <wangheyuan2@h-partners.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/2KEGWGY22MPHEXQ5Y3GXPWACUZMCNII6/ 
Rafael J. Wysocki (2):
  rtc: cmos: Fix event handler registration ordering issue
  rtc: cmos: Fix wake alarm breakage


-- 
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/IAYRDI 
 
Link:https://gitee.com/openeuler/kernel/pulls/13147

 

Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents cd4e99cb 6378c51b
Loading
Loading
Loading
Loading
+23 −9
Original line number Diff line number Diff line
@@ -1179,6 +1179,9 @@ static u32 rtc_handler(void *context)

static inline void rtc_wake_setup(struct device *dev)
{
	if (acpi_disabled)
		return;

	acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, dev);
	/*
	 * After the RTC handler is installed, the Fixed_RTC event should
@@ -1235,7 +1238,6 @@ static void cmos_wake_setup(struct device *dev)

	use_acpi_alarm_quirks();

	rtc_wake_setup(dev);
	acpi_rtc_info.wake_on = rtc_wake_on;
	acpi_rtc_info.wake_off = rtc_wake_off;

@@ -1301,10 +1303,12 @@ static void cmos_check_acpi_rtc_status(struct device *dev,

static int cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
{
	int irq, ret;

	cmos_wake_setup(&pnp->dev);

	if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) {
		unsigned int irq = 0;
		irq = 0;
#ifdef CONFIG_X86
		/* Some machines contain a PNP entry for the RTC, but
		 * don't define the IRQ. It should always be safe to
@@ -1313,13 +1317,17 @@ static int cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
		if (nr_legacy_irqs())
			irq = RTC_IRQ;
#endif
		return cmos_do_probe(&pnp->dev,
				pnp_get_resource(pnp, IORESOURCE_IO, 0), irq);
	} else {
		return cmos_do_probe(&pnp->dev,
				pnp_get_resource(pnp, IORESOURCE_IO, 0),
				pnp_irq(pnp, 0));
		irq = pnp_irq(pnp, 0);
	}

	ret = cmos_do_probe(&pnp->dev, pnp_get_resource(pnp, IORESOURCE_IO, 0), irq);
	if (ret)
		return ret;

	rtc_wake_setup(&pnp->dev);

	return 0;
}

static void cmos_pnp_remove(struct pnp_dev *pnp)
@@ -1403,7 +1411,7 @@ static inline void cmos_of_init(struct platform_device *pdev) {}
static int __init cmos_platform_probe(struct platform_device *pdev)
{
	struct resource *resource;
	int irq;
	int irq, ret;

	cmos_of_init(pdev);
	cmos_wake_setup(&pdev->dev);
@@ -1416,7 +1424,13 @@ static int __init cmos_platform_probe(struct platform_device *pdev)
	if (irq < 0)
		irq = -1;

	return cmos_do_probe(&pdev->dev, resource, irq);
	ret = cmos_do_probe(&pdev->dev, resource, irq);
	if (ret)
		return ret;

	rtc_wake_setup(&pdev->dev);

	return 0;
}

static int cmos_platform_remove(struct platform_device *pdev)