lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <501A271A.5030808@cn.fujitsu.com>
Date:	Thu, 02 Aug 2012 15:07:06 +0800
From:	Tang Chen <tangchen@...fujitsu.com>
To:	Jiang Liu <liuj97@...il.com>
CC:	Len Brown <lenb@...nel.org>, Tony Luck <tony.luch@...el.com>,
	Bob Moore <robert.moore@...el.com>,
	Huang Ying <ying.huang@...el.com>,
	Yinghai Lu <yinghai@...nel.org>,
	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
	Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>,
	Wen Congyang <wency@...fujitsu.com>,
	Taku Izumi <izumi.taku@...fujitsu.com>,
	Jiang Liu <jiang.liu@...wei.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Hanjun Guo <guohanjun@...wei.com>,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	linux-pci@...r.kernel.org, Gaohuai Han <hangaohuai@...wei.com>
Subject: Re: [RFC PATCH 1/3] ACPIHP: introduce a framework for ACPI based
 system device hotplug

Hi,

A little problem here. :)

On 07/28/2012 07:42 PM, Jiang Liu wrote:
> +int acpihp_register_slot(struct acpihp_slot *slot)
> +{
> +	int ret;
> +	char *name;
> +	size_t off;
> +
> +	if (!slot || !slot->slot_ops)
> +		return -EINVAL;
> +
> +	/* Hook top level hotplug slots under ACPI root device */
> +	if (slot->parent)
> +		slot->dev.parent = &slot->parent->dev;
> +	else
> +		slot->dev.parent = &acpi_root->dev;
> +
> +	ret = device_add(&slot->dev);
> +	if (!ret) {
> +		slot->flags |= ACPIHP_SLOT_FLAG_REGISTERED;
> +		name = kmalloc(PAGE_SIZE, GFP_KERNEL);
> +		if (name) {
> +			off = acpihp_generate_link_name(slot, name, 0);
> +			name[off - 1] = '\0';
> +			sysfs_create_link(&acpihp_slot_kset->kobj,
> +					  &slot->dev.kobj, name);

I got a compiler warning here:
  CC      drivers/acpi/hotplug/core.o
drivers/acpi/hotplug/core.c: In function ‘acpihp_register_slot’:
drivers/acpi/hotplug/core.c:199: warning: ignoring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result

Seems that we need to check the sysfs_create_link()'s return value here, and if it fails, 
shall we at least give a warning message here ?

Thanks. :)


> +			kfree(name);
> +		}
> +	}
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(acpihp_register_slot);

-- 
Best Regards,
Tang chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ