From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758839AbbCDPgq (ORCPT ); Wed, 4 Mar 2015 10:36:46 -0500 Received: from forward5m.mail.yandex.net ([37.140.138.5]:49076 "EHLO forward5m.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757129AbbCDPgp (ORCPT ); Wed, 4 Mar 2015 10:36:45 -0500 From: =?koi8-r?B?5dfHxc7JyiDwz8zRy8/X?= Envelope-From: drustafa@yandex.ru To: David Fries , Thorsten Bschorr Cc: "linux-kernel@vger.kernel.org" In-Reply-To: <20150302001713.GA6151@spacedout.fries.net> References: <54F02E22.5050901@bschorr.de> <20150228201737.GU6151@spacedout.fries.net> <369891425174502@web4m.yandex.ru> <20150301021744.GW6151@spacedout.fries.net> <20150302001713.GA6151@spacedout.fries.net> Subject: Re: [PATCH] Avoid null-pointer access in w1/slaves/w1_therm MIME-Version: 1.0 Message-Id: <4333121425483401@web21m.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 04 Mar 2015 18:36:41 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David 02.03.2015, 03:17, "David Fries" : > You are correct, it would be a race condition if it doesn't increment > the refcnt before unlocking the mutex, and it should get the mutex > before unref. šHere's an updated version, I haven't even tried to > compile it. > > What do you think Evgeniy? Sounds correct, it should do the trick, please cook up a patch, Thorsten, can you test it?