Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3419912pxf; Mon, 29 Mar 2021 01:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAfUzNlvYP/AWDz8CeT64VOYBnc+ueHZhO9GW9RoWhTk9h/I0o7xgu6tn41Mtk/oPpP37r X-Received: by 2002:a05:6402:b21:: with SMTP id bo1mr27117803edb.368.1617006685962; Mon, 29 Mar 2021 01:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006685; cv=none; d=google.com; s=arc-20160816; b=e9/t4DlMvWdAG4HVayNFvb6K9qWZtvgnCTiHit1QXSpPFnMakfgUJTD7wSbisrkERz BOBD4cC2rKJ4fsZrbIbVEsX3cVfEsbZqAd3uknPnc5ittgE8FSuyHhhrxnyK7soxxFxq wig5ryjy/SlSV45FNIdQE0uZIV+gafzGB6bBclcSZa8kQUGXnp7iCkBbx3DEJHpTrgLB zJrchVHrxaVmXm/w2DUSUKUOZ3kIzE7GDd1Wz6KxthyhunZPIhYHYgU3TKaI4nxqb1CB 2nMs7eREMcitfviRblEHfTvRr9prtfozfD6N5rZNe+9VTXh//e+htK1QsO9KXNFdvnsA hVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZE77Pk6Fa/G6HzE3l5UO53th/VixfKRNoT4lIkKcIHE=; b=s+Ly+X+CbVosk2IncQV1EoEnB9j5uHwXnINCxuy8E3TjZUSsqUqxd+dFO7fZuTAEkS TuvL8P9Gc1QGafHsn0DFuqfq8W0EzEscW7EEHZjKgJ+v3NTgp3aIKPLb2Q9gwrfyUOVO ay7rsNk5Bblsp/oNgB5F5I4Ubj3M8XWabmO82ysp17byYZUs+1aNktiBbmQ7y2rXsztz b0+J6ahNCQB84oTgPtqln5+RYtbC18nIkhY4dPfKy4gHPQjQW18QOeLhSOMLaV7C/RRg Xn7a2HOF1Q4tO9ZSSQRmB499Wgj57GW/FHCY2EHo81bCts4S8gtGyue6MjLo70HskTMr 4R0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lLM3EJcg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si12488615edv.538.2021.03.29.01.31.03; Mon, 29 Mar 2021 01:31:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lLM3EJcg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233848AbhC2IaH (ORCPT + 99 others); Mon, 29 Mar 2021 04:30:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:35278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233233AbhC2ITL (ORCPT ); Mon, 29 Mar 2021 04:19:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7DD4961613; Mon, 29 Mar 2021 08:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005951; bh=Fki+6t2i693xmHEl2L3+HBbS1O+MLL5WTpNnEgLEha8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lLM3EJcgSjMLv8e6yuUp5lNiyTwb4aC7ardxWvBw/RmRTBsIRNRiOhS5P7DUm8Oyi ZysmohojFkXCoHE6e8/UhJ0T2iqx4FLFUoezhrzzPnbtOvXB+UvFegbNK565fAG031 bcPbypfqcfLvYi1O+GC3wINHLXo/s3zUmh4lu8ao= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Zhang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 028/221] atm: uPD98402: fix incorrect allocation Date: Mon, 29 Mar 2021 09:55:59 +0200 Message-Id: <20210329075630.113008961@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Tong Zhang [ Upstream commit 3153724fc084d8ef640c611f269ddfb576d1dcb1 ] dev->dev_data is set in zatm.c, calling zatm_start() will overwrite this dev->dev_data in uPD98402_start() and a subsequent PRIV(dev)->lock (i.e dev->phy_data->lock) will result in a null-ptr-dereference. I believe this is a typo and what it actually want to do is to allocate phy_data instead of dev_data. Signed-off-by: Tong Zhang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/uPD98402.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c index 7850758b5bb8..239852d85558 100644 --- a/drivers/atm/uPD98402.c +++ b/drivers/atm/uPD98402.c @@ -211,7 +211,7 @@ static void uPD98402_int(struct atm_dev *dev) static int uPD98402_start(struct atm_dev *dev) { DPRINTK("phy_start\n"); - if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL))) + if (!(dev->phy_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL))) return -ENOMEM; spin_lock_init(&PRIV(dev)->lock); memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats)); -- 2.30.1