buffer->pointer = pnpacpi_kmalloc(buffer->length - 1, GFP_KERNEL); 
buffer->pointer = kcalloc(1, buffer->length - 1, GFP_KERNEL); 
int pnpacpi_build_resource_template(acpi_handle handle, 	struct acpi_buffer *buffer){	struct acpi_resource *resource;	int res_cnt = 0;	acpi_status status;	status = acpi_walk_resources(handle, METHOD_NAME__CRS, 		pnpacpi_count_resources, &res_cnt);	if (ACPI_FAILURE(status)) {		pnp_err("Evaluate _CRS failed");		return -EINVAL;	}	if (!res_cnt)		return -EINVAL;	buffer->length = sizeof(struct acpi_resource) * (res_cnt + 1) + 1;	buffer->pointer = pnpacpi_kmalloc(buffer->length - 1, GFP_KERNEL);	if (!buffer->pointer)		return -ENOMEM;	pnp_dbg("Res cnt %d", res_cnt);	resource = (struct acpi_resource *)buffer->pointer;	status = acpi_walk_resources(handle, METHOD_NAME__CRS, 		pnpacpi_type_resources, &resource);	if (ACPI_FAILURE(status)) {		kfree(buffer->pointer);		pnp_err("Evaluate _CRS failed");		return -EINVAL;	}	/* resource will pointer the end resource now */	resource->id = ACPI_RSTYPE_END_TAG;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a2822e7f00cdccbff8e507b5ebbddce1aa95eb5d/rsparser.c/buggy/drivers/pnp/pnpacpi/rsparser.c