From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbdKJP0k (ORCPT ); Fri, 10 Nov 2017 10:26:40 -0500 Received: from mail-pg0-f49.google.com ([74.125.83.49]:44243 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbdKJP0i (ORCPT ); Fri, 10 Nov 2017 10:26:38 -0500 X-Google-Smtp-Source: AGs4zMadk1UcUE6j8GMnMPXj6WgrI3XCaWBxmS/1OmROsdgvCYkmU3qsvXqJdnrchF3kp55IeQBFpw== Subject: Re: [PATCH] block: avoid null pointer dereference on null disk To: Colin King , linux-block@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171106175353.20199-1-colin.king@canonical.com> From: Jens Axboe Message-ID: <47f5fa8a-136f-a7c3-d713-363983653d2d@kernel.dk> Date: Fri, 10 Nov 2017 08:26:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171106175353.20199-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/06/2017 10:53 AM, Colin King wrote: > From: Colin Ian King > > It is possible that the pointer disk can be null and hence > we can get a null pointer deference when accessing disk->flags. > Add a null pointer check to avoid the dereference. Applied, thanks. -- Jens Axboe