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] [day] [month] [year] [list]
Message-ID: <532BDF8D.2060402@realtek.com>
Date:	Fri, 21 Mar 2014 14:43:25 +0800
From:	Roger <rogerable@...ltek.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Samuel Ortiz <sameo@...ux.intel.com>,
	Lee Jones <lee.jones@...aro.org>, Chris Ball <cjb@...top.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Maxim Levitsky <maximlevitsky@...il.com>,
	Alex Dubov <oakad@...oo.com>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	<linux-kernel@...r.kernel.org>, <linux-mmc@...r.kernel.org>,
	<driverdev-devel@...uxdriverproject.org>,
	<wei_wang@...lsil.com.cn>, <micky_ching@...lsil.com.cn>
Subject: Re: [PATCH v4 3/3] memstick: Add realtek USB memstick host driver

On 03/21/2014 07:18 AM, Andrew Morton wrote:
> On Wed, 12 Feb 2014 18:00:38 +0800 <rogerable@...ltek.com> wrote:
>
>> From: Roger Tseng <rogerable@...ltek.com>
>>
>> Realtek USB memstick host driver provides memstick host support based on the
>> Realtek USB card reader MFD driver.
>>
...
>> +static int rtsx_usb_ms_drv_probe(struct platform_device *pdev)
>> +{
>> +	struct memstick_host *msh;
>> +	struct rtsx_usb_ms *host;
>> +	struct rtsx_ucr *ucr;
>> +	int err;
>> +
>> +	ucr = usb_get_intfdata(to_usb_interface(pdev->dev.parent));
>> +	if (!ucr)
>> +		return -ENXIO;
>> +
>> +	dev_dbg(&(pdev->dev),
>> +			"Realtek USB Memstick controller found\n");
>> +
>> +	msh = memstick_alloc_host(sizeof(*host), &pdev->dev);
>> +	if (!msh)
>> +		return -ENOMEM;
>> +
>> +	host = memstick_priv(msh);
>> +	host->ucr = ucr;
>> +	host->msh = msh;
>> +	host->pdev = pdev;
>> +	host->power_mode = MEMSTICK_POWER_OFF;
>> +	platform_set_drvdata(pdev, host);
>> +
>> +	mutex_init(&host->host_mutex);
>> +	INIT_WORK(&host->handle_req, rtsx_usb_ms_handle_req);
>> +
>> +	init_completion(&host->detect_ms_exit);
>> +	host->detect_ms = kthread_create(rtsx_usb_detect_ms_card, host,
>> +			"rtsx_usb_ms_%d", pdev->id);
>> +	if (IS_ERR(host->detect_ms)) {
>> +		dev_dbg(&(pdev->dev),
>> +				"Unable to create polling thread.\n");
>> +		err = PTR_ERR(host->detect_ms);
>> +		goto err_out;
>> +	}
>> +
>> +	msh->request = rtsx_usb_ms_request;
>> +	msh->set_param = rtsx_usb_ms_set_param;
>> +	msh->caps = MEMSTICK_CAP_PAR4;
>> +
>> +	pm_runtime_enable(&pdev->dev);
>> +	err = memstick_add_host(msh);
>> +	if (err)
>> +		goto err_out;
>
> Isn't that kernel thread still running?
>
The kernel thread is created(kthread_create) but should not start before 
the "goto".

Did I miss anything or will it be better to move all kthread things 
after here?
>> +	wake_up_process(host->detect_ms);
>> +	return 0;
>> +err_out:
>> +	memstick_free_host(msh);
>> +	return err;
>> +}

Best regards,
Roger Tseng
--
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