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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96B1BC001DE for ; Tue, 25 Jul 2023 11:09:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234110AbjGYLJ3 (ORCPT ); Tue, 25 Jul 2023 07:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234109AbjGYLJP (ORCPT ); Tue, 25 Jul 2023 07:09:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CA632695 for ; Tue, 25 Jul 2023 04:08:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0A8016166F for ; Tue, 25 Jul 2023 11:08:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E7C7C433C7; Tue, 25 Jul 2023 11:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690283286; bh=sALAg72tNeCuME4pPnoqsdqUoMbldkD4A8ZgNW+V0dI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Olcxq8wXrWVPVdpZsTGrQQQqlfpSAyvVEyi7cz9oy+S0gwc8QJ7xGZhvDoXZYCLw2 wLVHBeD5eGWLH3cOOnsaLlvEG5X/RqBtHMkrlGfUIXRRZdT2nVGCwPBIPytE2j918w pd5XrJT8VZsAX87YsMOt/sEtVYXEYavS1gXdPu1g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Srinivas Kandagatla , Johan Hovold , Mark Brown Subject: [PATCH 5.15 21/78] ASoC: codecs: wcd938x: fix missing clsh ctrl error handling Date: Tue, 25 Jul 2023 12:46:12 +0200 Message-ID: <20230725104452.141955186@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725104451.275227789@linuxfoundation.org> References: <20230725104451.275227789@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johan Hovold commit ed0dd9205bf69593edb495cb4b086dbae96a3f05 upstream. Allocation of the clash control structure may fail so add the missing error handling to avoid dereferencing an error pointer. Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705123018.30903-4-johan+linaro@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/wcd938x.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -4086,6 +4086,10 @@ static int wcd938x_soc_codec_probe(struc WCD938X_ID_MASK); wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X); + if (IS_ERR(wcd938x->clsh_info)) { + pm_runtime_put(dev); + return PTR_ERR(wcd938x->clsh_info); + } wcd938x_io_init(wcd938x); /* Set all interrupts as edge triggered */