From patchwork Thu Jun 9 01:47:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1640986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zaz7mFCn; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=EoocNSOL; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LJRwQ0HRKz9sFk for ; Thu, 9 Jun 2022 11:54:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rFF7kSP0/IwznZd/icM+Vr/kdjUee94j6U4kvdwW7uI=; b=zaz7mFCnjJDq6a Yqdj1pTYGZ76DegJ7lrPbccurMfA4gjfiARe7Hx8woxK0eOPirhtYe36K4Tb1r1A4byBBsADQgxj/ 4RXdKyDZBnmMRDGfMz3UP/EgUk1cIB7Y5546H09k5jyIoV9JWb15HPqepfJg/DQt5lfizT1xAZiSD 9eDb9Pv4C7CQqVN4EpH2NcEzBJudVxX8HlzTt7xjQMjPB8H006yKr3a7zHGiVbSIXZVSH9hq4BgOu 4ZZD4+qD6Vn1NeC3DAj82yN+LIxcZ8pBczvPkcv7hki7keai8Q+6Q4ONykxp5qG6tTYDAN5tfgAZB UCEywtfTXUGNrYrfFRSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz7Gg-00FZ49-2X; Thu, 09 Jun 2022 01:47:26 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz7Ga-00FZ3b-QQ for openwrt-devel@lists.openwrt.org; Thu, 09 Jun 2022 01:47:22 +0000 Received: by mail-pg1-x529.google.com with SMTP id 123so10153402pgb.5 for ; Wed, 08 Jun 2022 18:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=dWL3Ym19RwFTo137rK8XE0f0OxJ9kJ4H5aMUPPWx6JA=; b=EoocNSOLB9bXy2+kn95R4dRd5qB6zZDk9XAasnmLxYSZrVKBoGjmB6uYqHn1aabF1N xv7cvbLBt6qH6eCC4tClBWGwLZJcNNAz8ayk9IO53kMiDfwSsf7ChmCRK5jTGEnPHBt6 +tYUeyBVasqpJyzsq/FWKkk22duncKhwvmHKllOmjlPNiWq9thoMicG0al3PGQ98Owpo ElYJwq+ol+tDxJiicqi8raQX6wn6+Z1Q9nz7n0p8c/URL4ItHl9lLXdnuFOz7JuXXy6f jP6zOWMnoGfb/MZMsSwRmcPESvlpJPUjB2v30zbtNhmS07XRubnarwg8sdcHsv0Zst4x hRWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=dWL3Ym19RwFTo137rK8XE0f0OxJ9kJ4H5aMUPPWx6JA=; b=JrYmORy8gIZy7Nyo8GznXDLBLyGX0A8k//cvRlorNMLqVObI0jmdT9ArTWi0yLPfqc +VccEPGhYgS5vsbMSp+CC/1uZ+0pvuur5Mq14tLJSiR/DXw1uROW1Om8XekIyr/LMaWl 19PTRPc3ctoIwnMwaZVBhQhAqf0nO2wzxtUEa9055UwFTxsQQm6Lf2GDI8PknAHE16Dv wPzFk+G1x4CoHsf7tIhxM4xZJW+ZQ3UO8bD2n0TvSotNRFlegpV/qBpFUrJt9/VsXp3R 8WlBWjAC8Hx7v8dvS48iVv0zxbQX3ec0uKJ6DOZHnM+WfGIsIczwCnJirwxqnkZpTuQg bDtg== X-Gm-Message-State: AOAM530ZLlZdJsJxoAlDsulFnN67GIio+ZCxWsCEfj7Pm84dmba/wvOR TAwVUpqVgodXrtOISBSU+SNFH/T3Fim/UQ== X-Google-Smtp-Source: ABdhPJxHWe3aAIRHscQovyDcMJm7mLeRNuMhw6J8iN6uq4vbX3etSWBr4V1dPa5FC7Ydk1cLPSi1JQ== X-Received: by 2002:a63:89c1:0:b0:3fc:5f5f:ef4c with SMTP id v184-20020a6389c1000000b003fc5f5fef4cmr32009276pgd.41.1654739237069; Wed, 08 Jun 2022 18:47:17 -0700 (PDT) Received: from ryzen.lan ([2601:648:8600:e73::8c6]) by smtp.gmail.com with ESMTPSA id iz18-20020a170902ef9200b0016363b15acasm15564017plb.112.2022.06.08.18.47.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 18:47:16 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH] uqmi: fix compilation with GCC12 Date: Wed, 8 Jun 2022 18:47:15 -0700 Message-Id: <20220609014715.1353-1-rosenp@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_184720_897462_06EA9328 X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: GCC12 doesn't seem to see that the completed member gets nulled. Use malloc to work around this. Signed-off-by: Rosen Penev --- commands-nas.c | 2 +- dev.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:529 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org GCC12 doesn't seem to see that the completed member gets nulled. Use malloc to work around this. Signed-off-by: Rosen Penev --- commands-nas.c | 2 +- dev.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/commands-nas.c b/commands-nas.c index 476cd61..9c0a626 100644 --- a/commands-nas.c +++ b/commands-nas.c @@ -710,7 +710,7 @@ static void cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg) { struct qmi_nas_get_cell_location_info_response res; - void *c, *t, *cell, *freq; + void *c = NULL, *t, *cell, *freq; int i, j; qmi_parse_nas_get_cell_location_info_response(msg, &res); diff --git a/dev.c b/dev.c index bd10207..b1cf2a3 100644 --- a/dev.c +++ b/dev.c @@ -205,7 +205,7 @@ void qmi_request_cancel(struct qmi_dev *qmi, struct qmi_request *req) int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req) { - bool complete = false; + bool *complete = malloc(sizeof(bool)); bool cancelled; if (!req->pending) @@ -214,8 +214,8 @@ int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req) if (req->complete) *req->complete = true; - req->complete = &complete; - while (!complete) { + req->complete = complete; + while (!*complete) { cancelled = uloop_cancelled; uloop_cancelled = false; uloop_run(); @@ -226,9 +226,10 @@ int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req) uloop_cancelled = cancelled; } - if (req->complete == &complete) + if (req->complete == complete) req->complete = NULL; + free(complete); return req->ret; }