Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5015315pxb; Sun, 7 Nov 2021 03:25:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE80uQpSC1qcDfAespnhD8NIMJrSxJNCNAthDhauQx634z/4dMZCFa8UvZrJRvGy6gDWws X-Received: by 2002:a05:6638:4091:: with SMTP id m17mr2119790jam.41.1636284349404; Sun, 07 Nov 2021 03:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636284349; cv=none; d=google.com; s=arc-20160816; b=Wuurt/JESHRrbIuRH1+nietk9e0pWOcytA7IoOCk1VddH6MZd3reNWDG9J54Ke1Kug 7770amysWsxA038QzC9Mj490JAkRe6IsoNBTin+px+Nb1gXgnh5Up2Ebvz+qvTMBY923 7ZMElgEGCXyNnrjPiWj9Kz2wx2+yOP9+8JVKMtI845ASPfQeV6pBP2inFZ9gP2uGx4FU 23U2vvJ37qzlXIeMuVjgj0yTmsa66kuhUzybpn0eVtIzyATd9mi7TvwOjw6Kk6kwC/SC JzuSzma5UCGjMTEZ2ju1cTvZwyRa7D4afUfYccOSn9Z9VqHFIgLQBwSroLVEderx6IXI W50A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZgnklXkGuSQOSxi3Q0vVQn+K+Oi7U4D51Q01YW0d9Rc=; b=hWQUVtiQShXCl9zwQxlO6e50AkmdAjmAacounH6a3+ZcKUUb46pVn9JXeLFIwQyD1o 4CDiycozFJxif5vsNMpFxaQWTA1rKXMmb+5ucPvpRdWehpa4U0GiUO4xkcHj7chqiVdr MnHyG7lZcYSTS4fGrsstE6O9yvPR/P8gPTwgqzIKd1/66VNI49k+bGVTnr/7zCU/7axe 5G+koTLutQeAfxsdewmFiaIPUIQukZPGuFa07OkA1hnNvXCfeMHCq94r97VlJzH1FT9G PJmb5xvF7v6ocfrDBBYUySoP6Ycfrc93R5HAhzhl896QBGyFdwmCZ7+tz3U64CyCBpzQ 6edw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dUeIgp8c; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si28444258jat.54.2021.11.07.03.25.36; Sun, 07 Nov 2021 03:25:49 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=dUeIgp8c; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234661AbhKFWJc (ORCPT + 99 others); Sat, 6 Nov 2021 18:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234600AbhKFWJ3 (ORCPT ); Sat, 6 Nov 2021 18:09:29 -0400 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AC83C061570; Sat, 6 Nov 2021 15:06:48 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id g25-20020a9d5f99000000b0055af3d227e8so14492371oti.11; Sat, 06 Nov 2021 15:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZgnklXkGuSQOSxi3Q0vVQn+K+Oi7U4D51Q01YW0d9Rc=; b=dUeIgp8c1Jt58DEjh4bg07kvJ6RUOaYY5woZse3NTGS/YDJfrxIxK36UTUhJqxFQK9 MTZbyq+M+ewYfZHYtJErKLABetMzGA09+/5PReAduUuf8eoUdq53mbfujqD8RpuBOF70 GzjT2eAypjWXC8qa/mD39SOWZe7i4kLYo7P4BjlYP4FirZHsgERD3Oc07XYMIcA+4iXQ MU+noSSjrjiesWvJ8ooYJJfG29LzWNeqjQede76JzE4sS4+T+XFguK5spr+LYq29s+UJ WRLb4GxPbxZDhHhG+vnjV8n+2I7kfhsKNhSWRuTW2N3vS78NziCxPSg3TCZoBH5IkDcp XqrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZgnklXkGuSQOSxi3Q0vVQn+K+Oi7U4D51Q01YW0d9Rc=; b=ZM/VXAdf2Mr6ZfmVvdY1J/07Zu6C0q4KN5gyYVX25Cym+myxcB0yUBOKnnfItz2tXk meLi4Snl2ys9tizi+L/ciBHuY4UMk6fhQa2AfN4qLHLtjRnGTwtad/ZBLFivhsnLc8pp gFK+COkSR3Hm0TgmQVuhGiVrAxqVSXwR2yjfxr6TYfQiKe00P35soihTiMoiv4fm4CJT BKfXnrdrYg0sXa9EOfN+1EdDcBlhuRVKZw/X0SZ7Ql+/koLQ6HpICzsc5XuttrLBbPas mfLTVK49FMizBMmZzKubGEfpN0gYKu58LW1e1F/0/WDsZ/5VLb2m7a8ZJxdMsp6eleRx JwrQ== X-Gm-Message-State: AOAM532RniwYaj2mXuYc7g/8lI1XES0JVm7hJk7rULxYx6MuKtPz7bpU rIVAT3QPDuvkkChsvvhU5fx39jUQw2X/TokAkeo= X-Received: by 2002:a9d:7617:: with SMTP id k23mr37127394otl.351.1636236407692; Sat, 06 Nov 2021 15:06:47 -0700 (PDT) MIME-Version: 1.0 References: <20211106104053.98761-1-ajaygargnsit@gmail.com> In-Reply-To: From: Ajay Garg Date: Sun, 7 Nov 2021 03:36:35 +0530 Message-ID: Subject: Re: [PATCH v2] tty: vt: keyboard: initialize "kbs" so that kfree(kbs) runs fine even if kbs is not kmalloced. To: Andy Shevchenko Cc: Pavel Skripkin , Greg KH , "jirislaby@kernel.org" , "kernel@esmil.dk" , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Andy, v3-patch has been posted at : https://lore.kernel.org/linux-serial/20211106220315.392842-1-ajaygargnsit@g= mail.com/T/#u Many thanks to Pavel and Andy for the review/help throughout. Let's continue on the v3-patch thread-link. > > It=E2=80=99s fine to add default case as I suggested. The problem with yo= ur contribution is in the commit message. Selling point would be (according= to the below) the smatch complain with the idea of having default case in= general. > > So something like: > =3D=3D=3D > The smatch tool gives a warning on the code in ... > > warning: ... > > This usually happens when switch has no default case and static analyzers= and even sometimes compilers can=E2=80=99t prove that all possible values = are covered. > > ... > > =3D=3D=3D >