From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753917AbcDSNHN (ORCPT ); Tue, 19 Apr 2016 09:07:13 -0400 Received: from foss.arm.com ([217.140.101.70]:39807 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752861AbcDSNHL (ORCPT ); Tue, 19 Apr 2016 09:07:11 -0400 Subject: Re: [PATCH V2 08/15] coresight: tmc: getting the right read_count on tmc_open() To: Mathieu Poirier , linux-arm-kernel@lists.infradead.org References: <1460483692-25061-1-git-send-email-mathieu.poirier@linaro.org> <1460483692-25061-9-git-send-email-mathieu.poirier@linaro.org> Cc: linux-kernel@vger.kernel.org From: Suzuki K Poulose Message-ID: <57162D7C.7040003@arm.com> Date: Tue, 19 Apr 2016 14:07:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460483692-25061-9-git-send-email-mathieu.poirier@linaro.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/04/16 18:54, Mathieu Poirier wrote: > In function tmc_open(), if tmc_read_prepare() fails variable > drvdata->read_count is not decremented, causing unwanted > access to drvdata->buf and very likely, a crash dump. > > By moving the incrementation to a place where we know things > are stable this kind of situation is avoided. > > Signed-off-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki.Poulose@arm.com (Suzuki K Poulose) Date: Tue, 19 Apr 2016 14:07:08 +0100 Subject: [PATCH V2 08/15] coresight: tmc: getting the right read_count on tmc_open() In-Reply-To: <1460483692-25061-9-git-send-email-mathieu.poirier@linaro.org> References: <1460483692-25061-1-git-send-email-mathieu.poirier@linaro.org> <1460483692-25061-9-git-send-email-mathieu.poirier@linaro.org> Message-ID: <57162D7C.7040003@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 12/04/16 18:54, Mathieu Poirier wrote: > In function tmc_open(), if tmc_read_prepare() fails variable > drvdata->read_count is not decremented, causing unwanted > access to drvdata->buf and very likely, a crash dump. > > By moving the incrementation to a place where we know things > are stable this kind of situation is avoided. > > Signed-off-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose