From patchwork Tue Jan 28 14:03:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 232516 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 87CB7C2D0DB for ; Tue, 28 Jan 2020 14:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5379220702 for ; Tue, 28 Jan 2020 14:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222382; bh=48INwzqSoZjyu+5KRe05uD1SrCXF3yGRKmKXqLV/Nvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DegICZPj/UiXEtfc7J+LjuCNBVC/14+vq84XDGgJ68YazEFnKMnPy9iHGQj07nx62 5ZT++VI1ZSIwM09Ei2HUZ1ELW//rDaambrJCub4Iy9om6nBaQFNrMcZNE0fZMz8qs3 R2d0zDVc8FKuDcMBgorTbrwHg1bAyQax/jFv+imY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729999AbgA1OQq (ORCPT ); Tue, 28 Jan 2020 09:16:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:40258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729724AbgA1OQp (ORCPT ); Tue, 28 Jan 2020 09:16:45 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B633221739; Tue, 28 Jan 2020 14:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221005; bh=48INwzqSoZjyu+5KRe05uD1SrCXF3yGRKmKXqLV/Nvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZcteJ+6UWjKNnRqDnu0b95emYH/KUoJiWpoHbua4DVHn+JnTNqNmfSJw7v4xeY2O h7TJtuOYkV7JuLPfNsKvlnmGtBxHfFYWjy2s/m0+O47siqbsdJcXLZdMdL/luox5tV McETs0G09oyckmq53P0+Ef28gutsNUvICrpXCchg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YueHaibing , Sasha Levin Subject: [PATCH 4.9 050/271] tty: ipwireless: Fix potential NULL pointer dereference Date: Tue, 28 Jan 2020 15:03:19 +0100 Message-Id: <20200128135856.365386031@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: YueHaibing [ Upstream commit 7dd50e205b3348dc7784efbdf85723551de64a25 ] There is a potential NULL pointer dereference in case alloc_ctrl_packet() fails and returns NULL. Fixes: 099dc4fb6265 ("ipwireless: driver for PC Card 3G/UMTS modem") Signed-off-by: YueHaibing Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/ipwireless/hardware.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c index df0204b6148fb..4417f75684221 100644 --- a/drivers/tty/ipwireless/hardware.c +++ b/drivers/tty/ipwireless/hardware.c @@ -1515,6 +1515,8 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw) sizeof(struct ipw_setup_get_version_query_packet), ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP, TL_SETUP_SIGNO_GET_VERSION_QRY); + if (!ver_packet) + return; ver_packet->header.length = sizeof(struct tl_setup_get_version_qry); /*