From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC6B3C2B9F7 for ; Wed, 26 May 2021 10:44:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCD406023D for ; Wed, 26 May 2021 10:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234138AbhEZKqP (ORCPT ); Wed, 26 May 2021 06:46:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:53468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234034AbhEZKqK (ORCPT ); Wed, 26 May 2021 06:46:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D00D1613D3; Wed, 26 May 2021 10:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622025879; bh=6Z4pHqWBFL4+NnMmSLTg0IhsxKB/BpUB7Hlh/TSkQww=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Rz75V34ZSLNGrtay7qx/vSs+FW2ut0JgoU4g8CareFZX9xBuuHtN2a/CcecwoSnaX Tlz8ryPPolVhDNlM7T741vtRS/qz2IHUVMpZzII6i5E/0wnkGu2mNeBwHWR+MtnGGP UHxJPncCHDGVtI9GbRY3EF0Z3pAvMA9PbjPkFf6MIOmI6fLCWVdY/ipg+BNw2LcAt7 mRBIG1mdvJCZ8LCL/+dE2bdNWrAZO589dRHQsTo+ccrNFa42B8HYMPselxIEfPi7bD Grb1JVDcEkcMHhujaS1SEmlWPokEIbOWBLI/zdHPfxqA4mGl6Makft07FPFNM908b+ 62TK8smMtEbUA== Date: Wed, 26 May 2021 12:44:37 +0200 (CEST) From: Jiri Kosina To: =?ISO-8859-15?Q?Jos=E9_Exp=F3sito?= cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] HID: magicmouse: fix crash when disconnecting Magic Trackpad 2 In-Reply-To: <20210510062237.319457-1-jose.exposito89@gmail.com> Message-ID: References: <20210509155138.39601-1-jose.exposito89@gmail.com> <20210510062237.319457-1-jose.exposito89@gmail.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 May 2021, José Expósito wrote: > When the Apple Magic Trackpad 2 is connected over USB it registers four > hid_device report descriptors, however, the driver only handles the one > with type HID_TYPE_USBMOUSE and ignores the other three, thus, no driver > data is attached to them. > > When the device is disconnected, the remove callback is called for the > four hid_device report descriptors, crashing when the driver data is > NULL. > > Check that the driver data is not NULL before using it in the remove > callback. Applied, thank you. -- Jiri Kosina SUSE Labs