From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758859AbdADJgY (ORCPT ); Wed, 4 Jan 2017 04:36:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:54112 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262AbdADJgW (ORCPT ); Wed, 4 Jan 2017 04:36:22 -0500 Date: Wed, 4 Jan 2017 10:36:18 +0100 (CET) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: "Xu, Even" cc: "srinivas.pandruvada@linux.intel.com" , "linux-input@vger.kernel.org" , "benjamin.tissoires@redhat.com" , "linux-kernel@vger.kernel.org" , "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "Shevchenko, Andriy" Subject: Re: [PATCH 7/7] misc: intel-ish-client: add intel ishtp clients driver In-Reply-To: <1483512029.25176.7.camel@intel.com> Message-ID: References: <1482456149-4841-1-git-send-email-even.xu@intel.com> <1482456149-4841-7-git-send-email-even.xu@intel.com> <1483512029.25176.7.camel@intel.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Jan 2017, Xu, Even wrote: > > [ ... snip ... ] > > > > > > +static ssize_t ishtp_cl_write(struct file *file, const char __user > > > *ubuf, > > > + size_t length, loff_t *offset) > > > +{ > > > + struct ishtp_cl_miscdev *ishtp_cl_misc = file- > > > >private_data; > > > + struct ishtp_cl *cl; > > > + void *write_buf; > > > + struct ishtp_device *dev; > > > + int ret; > > > + > > > + /* Non-blocking semantics are not supported */ > > > + if (file->f_flags & O_NONBLOCK) { > > > + ret = -EINVAL; > > > + goto out_unlock; > > When taking the error path here you'd try to unlockĀ  > > ishtp_cl_misc->cl_mutex before actually acquiring it. > > > > Thanks for your comments, Jiri, I update my patch below: Greg, how would you like to handle this (after you're done with reviewing it of course), given that this driver depends on the preceeding 6 patches to intel-ish-hid driver? Thanks, -- Jiri Kosina SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Kosina Subject: Re: [PATCH 7/7] misc: intel-ish-client: add intel ishtp clients driver Date: Wed, 4 Jan 2017 10:36:18 +0100 (CET) Message-ID: References: <1482456149-4841-1-git-send-email-even.xu@intel.com> <1482456149-4841-7-git-send-email-even.xu@intel.com> <1483512029.25176.7.camel@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Return-path: Received: from mx2.suse.de ([195.135.220.15]:54112 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262AbdADJgW (ORCPT ); Wed, 4 Jan 2017 04:36:22 -0500 In-Reply-To: <1483512029.25176.7.camel@intel.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: "Xu, Even" Cc: "srinivas.pandruvada@linux.intel.com" , "linux-input@vger.kernel.org" , "benjamin.tissoires@redhat.com" , "linux-kernel@vger.kernel.org" , "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "Shevchenko, Andriy" On Wed, 4 Jan 2017, Xu, Even wrote: > > [ ... snip ... ] > > > > > > +static ssize_t ishtp_cl_write(struct file *file, const char __user > > > *ubuf, > > > + size_t length, loff_t *offset) > > > +{ > > > + struct ishtp_cl_miscdev *ishtp_cl_misc = file- > > > >private_data; > > > + struct ishtp_cl *cl; > > > + void *write_buf; > > > + struct ishtp_device *dev; > > > + int ret; > > > + > > > + /* Non-blocking semantics are not supported */ > > > + if (file->f_flags & O_NONBLOCK) { > > > + ret = -EINVAL; > > > + goto out_unlock; > > When taking the error path here you'd try to unlockĀ  > > ishtp_cl_misc->cl_mutex before actually acquiring it. > > > > Thanks for your comments, Jiri, I update my patch below: Greg, how would you like to handle this (after you're done with reviewing it of course), given that this driver depends on the preceeding 6 patches to intel-ish-hid driver? Thanks, -- Jiri Kosina SUSE Labs